Part Number Hot Search : 
CAT36 EC3B17 APL3520C 74LVC1G SN69040B P1240 EC3B22 2SK3576
Product Description
Full Text Search
 

To Download M38503E4FP Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers description the 3850 group (spec. h) is the 8-bit microcomputer based on the 740 family core technology. the 3850 group (spec. h) is designed for the household products and office automation equipment and includes serial i/o functions, 8-bit timer, and a-d converter. features basic machine-language instructions ...................................... 71 minimum instruction execution time .................................. 0.5 s (at 8 mhz oscillation frequency) memory size rom ................................................................... 8k to 32k bytes ram ................................................................. 512 to 1024 bytes programmable input/output ports ............................................ 34 interrupts ................................................. 15 sources, 14 vectors timers ............................................................................. 8-bit ? 4 serial i/o1 .................... 8-bit ? 1(uart or clock-synchronized) serial i/o2 ................................... 8-bit ? 1(clock-synchronized) pwm ............................................................................... 8-bit ? 1 a-d converter ............................................... 10-bit ? 5 channels watchdog timer ............................................................ 16-bit ? 1 clock generating circuit ..................................... built-in 2 circuits (connect to external ceramic resonator or quartz-crystal oscillator) pin configuration (top view) fig. 1 m38503mxh-xxxfp/sp pin configuration power source voltage in high-speed mode .................................................. 4.0 to 5.5 v (at 8 mhz oscillation frequency) in middle-speed mode ............................................... 2.7 to 5.5 v (at 8 mhz oscillation frequency) in low-speed mode .................................................... 2.7 to 5.5 v (at 32 khz oscillation frequency) power dissipation in high-speed mode ..........................................................34 mw (at 8 mhz oscillation frequency, at 5 v power source voltage) in low-speed mode ............................................................ 60 w (at 32 khz oscillation frequency, at 3 v power source voltage) operating temperature range .................................... ?0 to 85? application office automation equipment, fa equipment, household products, consumer electronics, etc. package type : fp ........................... 42p2r-a/e (42-pin plastic-molded ssop) package type : sp ........................... 42p4b (42-pin plastic-molded sdip) p 4 0 / c n t r 1 p 4 1 / i n t 0 p 4 2 / i n t 1 p4 3 /int 2 /s cmp2 a v s s p4 4 /int 3 /pwm v r e f v c c p 0 0 / s i n 2 p 0 4 p 0 5 p 0 6 p 0 7 p 1 1 / ( l e d 1 ) p 1 2 / ( l e d 2 ) p1 3 /(led 3 ) p 1 4 / ( l e d 4 ) p 1 5 / ( l e d 5 ) p1 0 /(led 0 ) p 0 1 / s o u t 2 p0 2 /s clk2 p3 1 /an 1 p 3 2 / a n 2 p 3 0 / a n 0 p 3 3 / a n 3 p3 4 /an 4 p 0 3 / s r d y 2 40 41 42 22 23 24 25 26 27 28 29 30 31 32 34 35 36 37 38 39 33 3 2 1 21 20 19 18 17 16 15 14 13 12 11 9 8 7 6 5 4 10 m 3 8 5 0 3 m x h - x x x f p / s p p 1 6 / ( l e d 6 ) p 1 7 / ( l e d 7 ) p 2 7 / c n t r 0 / s r d y 1 p 2 6 / s c l k p 2 5 / t x d p2 4 /rx d p2 3 p 2 2 c n v s s p 2 1 / x c i n p2 0 /x cou t rese t x i n x o u t v s s v p p : flash memory version
2 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers functional block diagram fig. 2 functional block diagram functional block i n t 0 v r e f a v s s r a m r o m c p u a x y s p c h p c l p s v s s 2 1 r e s e t 1 8 v c c 1 1 5 c n v s s 2 3 x i n 1 9 2 0 s i / o 1 ( 8 ) r e s e t i n p u t c l o c k g e n e r a t i n g c i r c u i t m a i n - c l o c k i n p u t m a i n - c l o c k o u t p u t a - d c o n v e r t e r ( 1 0 ) c n t r 0 c n t r 1 t i m e r y ( 8 ) t i m e r x ( 8 ) p r e s c a l e r 1 2 ( 8 ) p r e s c a l e r x ( 8 ) p r e s c a l e r y ( 8 ) t i m e r 1 ( 8 ) t i m e r 2 ( 8 ) s u b - c l o c k i n p u t x o u t x c i n x c o u t s u b - c l o c k o u t p u t w a t c h d o g t i m e r r e s e t p 2 ( 8 ) p 3 ( 5 ) i / o p o r t p 2 i / o p o r t p 3 p 4 ( 5 ) i / o p o r t p 4 i n t 3 4 6 8 5 7 3 9 4 1 3 8 4 0 4 2 9 1 1 1 3 1 7 1 0 1 2 1 4 1 6 p 1 ( 8 ) i / o p o r t p 1 2 2 2 4 2 6 2 8 2 3 2 5 2 7 2 9 p 0 ( 8 ) i / o p o r t p 0 3 0 3 1 3 2 3 3 3 4 3 5 3 6 3 7 p w m ( 8 ) x c i n x c o u t s i / o 2 ( 8 )
3 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers v cc , v ss pin description functions name pin apply voltage of 2.7 v 5.5 v to vcc, and 0 v to vss. this pin controls the operation mode of the chip. normally connected to v ss . reset input pin for active l. input and output pins for the clock generating circuit. connect a ceramic resonator or quartz-crystal oscillator between the x in and x out pins to set the oscillation frequency. when an external clock is used, connect the clock source to the x in pin and leave the x out pin open. 8-bit cmos i/o port. i/o direction register allows each pin to be individually programmed as either input or output. cmos compatible input level. cmos 3-state output structure. p1 0 to p1 7 (8 bits) are enabled to output large current for led drive. power source table 1 pin description function except a port function clock input clock output i/o port p0 cnv ss input cnv ss reset reset input x in x out p0 0 /s in2 p0 1 /s out2 p0 2 /s clk2 p0 3 /s rdy2 p0 4 p0 7 i/o port p1 p1 0 p1 7 serial i/o2 function pin sub-clock generating circuit i/o pins (connect a resonator) i/o port p2 i/o port p3 i/o port p4 8-bit cmos i/o port. i/o direction register allows each pin to be individually programmed as either input or output. cmos compatible input level. p2 0 , p2 1 , p2 4 to p2 7 : cmos3-state output structure. p2 2 , p2 3 : n-channel open-drain structure. serial i/o1 function pin serial i/o1 function pin/ timer x function pin a-d converter input pin timer y function pin interrupt input pins interrupt input pin s cmp2 output pin interrupt input pin pwm output pin 8-bit cmos i/o port with the same function as port p0. cmos compatible input level. cmos 3-state output structure. 8-bit cmos i/o port with the same function as port p0. cmos compatible input level. cmos 3-state output structure. p2 0 /x cout p2 1 /x cin p2 2 p2 3 p2 4 /rxd p2 5 /txd p2 6 /s clk p2 7 /cntr 0 / s rdy1 p3 0 /an 0 p3 4 /an 4 p4 0 /cntr 1 p4 1 /int 0 p4 2 /int 1 p4 3 /int 2 /s cmp2 p4 4 /int 3 /pwm
4 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers part numbering fig. 3 part numbering m 3 8 5 03 m 4 h x x xs p p r o d u c t n a m e package type sp : 42p4b fp : 42p2r-a/e ss : 42s1b-a rom number omitted in one time prom version shipped in blank, eprom version, and flash memory version. rom/prom/flash memory size 1 2 3 4 5 6 7 8 : 4 0 9 6 b y t e s : 8 1 9 2 b y t e s : 1 2 2 8 8 b y t e s : 1 6 3 8 4 b y t e s : 2 0 4 8 0 b y t e s : 2 4 5 7 6 b y t e s : 2 8 6 7 2 b y t e s : 3 2 7 6 8 b y t e s the first 128 bytes and the last 2 bytes of rom are reserved areas ; they cannot be used as a user s rom area. however, they can be programmed or erased in the flash memory version, so that the users can use them. memory type m : mask rom version e : eprom or one time prom version f : flash memory version r a m s i z e 0 1 2 3 4 : 192 bytes : 256 bytes : 384 bytes : 512 bytes : 640 bytes : standard omitted in one time prom version shipped in blank, eprom version, and flash memory version. h : partial specification changed version : 3 6 8 6 4 b y t e s : 4 0 9 6 0 b y t e s : 4 5 0 5 6 b y t e s : 4 9 1 5 2 b y t e s : 5 3 2 4 8 b y t e s : 5 7 3 4 4 b y t e s : 6 1 4 4 0 b y t e s 9 a b c d e f 5 6 7 8 9 : 7 6 8 b y t e s : 8 9 6 b y t e s : 1 0 2 4 b y t e s : 1 5 3 6 b y t e s : 2 0 4 8 b y t e s
5 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers group expansion mitsubishi plans to expand the 3850 group (spec. h) as follows. memory type support for mask rom, one time prom, and flash memory ver- sions. memory size flash memory size ......................................................... 32 k bytes one time prom size ..................................................... 24 k bytes mask rom size ................................................... 8 k to 32 k bytes ram size ............................................................... 512 to 1 k bytes packages 42p4b ......................................... 42-pin shrink plastic-molded dip 42p2r-a/e ........................................... 42-pin plastic-molded sop 42s1b-a .................. 42-pin shrink ceramic dip (eprom version) fig. 4 memory expansion plan memory expansion plan 32k 28k 24k 20k 1 6 k 1 2 k 8 k 3 8 45 1 2 640 7 6 8 896 1024 1152 1280 1408 1 5 3 6 2048 r o m e x t e r a n a l r o m s i z e ( b y t e s ) ram size (bytes) a s o f n o v . 2 0 0 0 m38507m8/f8 m38504m6/e6 m 3 8 5 0 3 m 4 h m 3 8 5 0 3 m 2 h u n d e r d e v e l o p m e n t products under development or planning: the development schedule and specification may be revised without notice. the development of planning products may be stopped. m a s s p r o d u c t i o n m a s s p r o d u c t i o n mass production
6 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers currently planning products are listed below. ram size (bytes) remarks package table 2 support products product name as of nov. 2000 24576 (24446) rom size (bytes) rom size for user in ( ) m38503m2h-xxxsp m38503m2h-xxxfp m38503m4h-xxxsp m38503m4h-xxxfp m38504m6-xxxsp m38504e6-xxxsp m388504e6sp m388504e6ss m38504m6-xxxfp m38504e6-xxxfp m38504e6fp 42p4b 42p2r-a/e 424p4b 42p2r-a/e 424p4b 42s1b-a 42p2r-a/e mask rom version mask rom version mask rom version mask rom version mask rom version one time prom version one time prom version (blank) eprom version mask rom version one time prom version one time prom version (blank) 8192 (8062) 512 16384 (16254) 640 512 table 3 3850 group (standard) and 3850 group (spec. h) corresponding products 3850 group (standard) m38503m2-xxxfp/sp m38503m4-xxxfp/sp m38503e4-xxxfp/sp M38503E4FP/sp m38503e4ss 3850 group (spec. h) m38503m2h-xxxfp/sp m38503m4h-xxxfp/sp m38504m6-xxxfp/sp m38504e6-xxxfp/sp m38504e6fp/sp m38504e6ss m38507m8-xxxfp/sp m38507f8fp/sp m37516rss table 4 differences between 3850 group (standard) and 3850 group (spec. h) serial i/o a-d converter large current port 3850 group (standard) 1: serial i/o (uart or clock-synchronized) unserviceable in low-speed mode 5: p1 3 p1 7 3850 group (spec. h) 2: serial i/o1 (uart or clock-synchronized) serial i/o2 (clock-synchronized) serviceable in low-speed mode 8: p1 0 p1 7 notes on differences between 3850 group (standard) and 3850 group (spec. h) (1) the absolute maximum ratings of 3850 group (spec. h) is smaller than that of 3850 group (standard). power source voltage vcc = 0.3 to 6.5 v cnvss input voltage v i = 0.3 to vcc +0.3 v (2) the oscillation circuit constants of x in -x out , x cin -x cout may be some differences between 3850 group (standard) and 3850 group (spec. h). (3) do not write any data to the reserved area and the reserved bit. (do not change the contents after rest.) (4) fix bit 3 of the cpu mode register to 1 . (5) be sure to perform the termination of unused pins.
7 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers functional description central processing unit (cpu) the 3850 group (spec. h) uses the standard 740 family instruc- tion set. refer to the table of 740 family addressing modes and machine instructions or the 740 family software manual for de- tails on the instruction set. machine-resident 740 family instructions are as follows: the fst and slw instructions cannot be used. the stp, wit, mul, and div instructions can be used. [accumulator (a)] the accumulator is an 8-bit register. data operations such as data transfer, etc., are executed mainly through the accumulator. [index register x (x)] the index register x is an 8-bit register. in the index addressing modes, the value of the operand is added to the contents of register x and specifies the real address. [index register y (y)] the index register y is an 8-bit register. in partial instruction, the value of the operand is added to the contents of register y and specifies the real address. [stack pointer (s)] the stack pointer is an 8-bit register used during subroutine calls and interrupts. this register indicates start address of stored area (stack) for storing registers during subroutine calls and interrupts. the low-order 8 bits of the stack address are determined by the contents of the stack pointer. the high-order 8 bits of the stack ad- dress are determined by the stack page selection bit. if the stack page selection bit is 0 , the high-order 8 bits becomes 00 16 . if the stack page selection bit is 1 , the high-order 8 bits becomes 01 16 . the operations of pushing register contents onto the stack and popping them from the stack are shown in figure 6. store registers other than those described in figure 6 with pro- gram when the user needs them during interrupts or subroutine calls. [program counter (pc)] the program counter is a 16-bit counter consisting of two 8-bit registers pc h and pc l . it is used to indicate the address of the next instruction to be executed. fig. 5 740 family cpu register structure a accumulator b7 b7 b7 b7 b0 b7 b15 b0 b7 b0 b0 b0 b0 x index register x y index register y s stack pointer pc l program counter pc h n v t b d i z c processor status register (ps) carry flag zero flag interrupt disable flag decimal mode flag break flag index x mode flag overflow flag negative flag
8 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers table 5 push and pop instructions of accumulator or processor status register accumulator processor status register push instruction to stack pha php pop instruction from stack pla plp fig. 6 register push and pop at interrupt generation and subroutine call note : condition for acceptance of an interrupt interrupt enable flag is 1 execute jsr on-going routine m ( s )( p c h ) ( s ) ( s ) 1 m (s) (pc l ) e x e c u t e r t s (pc l )m (s) ( s ) ( s ) 1 (s) (s) + 1 ( s ) ( s ) + 1 ( p c h )m ( s ) subroutine pop return address from stack p u s h r e t u r n a d d r e s s o n s t a c k m (s) (ps) execute rti (ps) m (s) (s) (s) 1 (s) (s) + 1 i n t e r r u p t s e r v i c e r o u t i n e p o p c o n t e n t s o f p r o c e s s o r s t a t u s r e g i s t e r f r o m s t a c k m ( s )( p c h ) ( s ) ( s ) 1 m (s) (pc l ) (s) (s) 1 (pc l )m (s) ( s ) ( s ) + 1 ( s ) ( s ) + 1 ( p c h )m ( s ) p o p r e t u r n a d d r e s s f r o m s t a c k i f l a g i s s e t f r o m 0 t o 1 f e t c h t h e j u m p v e c t o r p u s h r e t u r n a d d r e s s o n s t a c k p u s h c o n t e n t s o f p r o c e s s o r s t a t u s r e g i s t e r o n s t a c k i n t e r r u p t r e q u e s t ( n o t e ) interrupt disable flag is 0
9 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers [processor status register (ps)] the processor status register is an 8-bit register consisting of 5 flags which indicate the status of the processor after an arithmetic operation and 3 flags which decide mcu operation. branch opera- tions can be performed by testing the carry (c) flag , zero (z) flag, overflow (v) flag, or the negative (n) flag. in decimal mode, the z, v, n flags are not valid. bit 0: carry flag (c) the c flag contains a carry or borrow generated by the arithmetic logic unit (alu) immediately after an arithmetic operation. it can also be changed by a shift or rotate instruction. bit 1: zero flag (z) the z flag is set if the result of an immediate arithmetic operation or a data transfer is 0 , and cleared if the result is anything other than 0 . bit 2: interrupt disable flag (i) the i flag disables all interrupts except for the interrupt generated by the brk instruction. interrupts are disabled when the i flag is 1 . bit 3: decimal mode flag (d) the d flag determines whether additions and subtractions are executed in binary or decimal. binary arithmetic is executed when this flag is 0 ; decimal arithmetic is executed when it is 1 . decimal correction is automatic in decimal mode. only the adc and sbc instructions can be used for decimal arithmetic. bit 4: break flag (b) the b flag is used to indicate that the current interrupt was generated by the brk instruction. the brk flag in the processor status register is always 0 . when the brk instruction is used to generate an interrupt, the processor status register is pushed onto the stack with the break flag set to 1 . bit 5: index x mode flag (t) when the t flag is 0 , arithmetic operations are performed between accumulator and memory. when the t flag is 1 , direct arithmetic operations and direct data transfers are enabled between memory locations. bit 6: overflow flag (v) the v flag is used during the addition or subtraction of one byte of signed data. it is set if the result exceeds +127 to -128. when the bit instruction is executed, bit 6 of the memory location operated on by the bit instruction is stored in the overflow flag. bit 7: negative flag (n) the n flag is set if the result of an arithmetic operation or data transfer is negative. when the bit instruction is executed, bit 7 of the memory location operated on by the bit instruction is stored in the negative flag. table 6 set and clear instructions of each bit of processor status register set instruction clear instruction c flag z flag i flag d flag b flag t flag v flag n flag sec clc _ _ sei cli sed cld _ _ set clt clv _ _ _
10 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers [cpu mode register (cpum)] 003b 16 the cpu mode register contains the stack page selection bit, etc. the cpu mode register is allocated at address 003b 16 . fig. 7 structure of cpu mode register c p u m o d e r e g i s t e r ( cpum : address 003b 16 ) b 7 b0 s t a c k p a g e s e l e c t i o n b i t 0 : 0 p a g e 1 : 1 p a g e f i x t h i s b i t t o 1 . p r o c e s s o r m o d e b i t s b 1 b 0 0 0 : s i n g l e - c h i p m o d e 0 1 : 1 0 : n o t a v a i l a b l e 1 1 : p o r t x c s w i t c h b i t 0 : i / o p o r t f u n c t i o n ( s t o p o s c i l l a t i n g ) 1 : x c i n x c o u t o s c i l l a t i n g f u n c t i o n main clock (x in x out ) stop bit 0 : oscillating 1 : stopped main clock division ratio selection bits b7 b6 0 0 : = f(x in )/2 (high-speed mode) 0 1 : = f(x in )/8 (middle-speed mode) 1 0 : = f(x cin )/2 (low-speed mode) 1 1 : not available
11 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers memory special function register (sfr) area the special function register area in the zero page contains control registers such as i/o ports and timers. ram ram is used for data storage and for stack area of subroutine calls and interrupts. rom the first 128 bytes and the last 2 bytes of rom are reserved for device testing and the rest is user area for storing programs. interrupt vector area the interrupt vector area contains reset and interrupt vectors. zero page access to this area with only 2 bytes is possible in the zero page addressing mode. special page access to this area with only 2 bytes is possible in the special page addressing mode. fig. 8 memory map diagram 0 1 0 0 1 6 0000 1 6 0 0 4 0 1 6 ff00 16 f f d c 1 6 fffe 1 6 ffff 1 6 1 9 2 2 5 6 3 8 4 5 1 2 6 4 0 7 6 8 8 9 6 1 0 2 4 1 5 3 6 2 0 4 8 x x x x 1 6 0 0 f f 1 6 0 1 3 f 1 6 0 1 b f 1 6 0 2 3 f 1 6 0 2 b f 1 6 0 3 3 f 1 6 0 3 b f 1 6 0 4 3 f 1 6 0 6 3 f 1 6 0 8 3 f 1 6 4 0 9 6 8 1 9 2 1 2 2 8 8 1 6 3 8 4 2 0 4 8 0 2 4 5 7 6 2 8 6 7 2 3 2 7 6 8 3 6 8 6 4 4 0 9 6 0 4 5 0 5 6 4 9 1 5 2 5 3 2 4 8 5 7 3 4 4 6 1 4 4 0 f 0 0 0 1 6 e 0 0 0 1 6 d 0 0 0 1 6 c 0 0 0 1 6 b 0 0 0 1 6 a 0 0 0 1 6 9 0 0 0 1 6 8 0 0 0 1 6 7 0 0 0 1 6 6 0 0 0 1 6 5 0 0 0 1 6 4 0 0 0 1 6 3 0 0 0 1 6 2 0 0 0 1 6 1 0 0 0 1 6 f 0 8 0 1 6 e 0 8 0 1 6 d 0 8 0 1 6 c 0 8 0 1 6 b 0 8 0 1 6 a 0 8 0 1 6 9 0 8 0 1 6 8 0 8 0 1 6 7 0 8 0 1 6 6 0 8 0 1 6 5 0 8 0 1 6 4 0 8 0 1 6 3 0 8 0 1 6 2 0 8 0 1 6 1 0 8 0 1 6 y y y y 1 6 zzzz 1 6 ram r o m 0ff0 16 0fff 1 6 sfr area not used i n t e r r u p t v e c t o r a r e a rom area r e s e r v e d r o m a r e a ( 1 2 8 b y t e s ) z e r o p a g e special page ram area r a m s i z e ( b y t e s ) a d d r e s s x x x x 1 6 r o m s i z e ( b y t e s ) address yyyy 16 reserved rom are a address zzzz 16 n o t u s e d sfr area (note) n o t e : f l a s h m e m o r y v e r s i o n o n l y
12 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 9 memory map of special function register (sfr) 0 0 2 0 1 6 0 0 2 1 1 6 0 0 2 2 1 6 0023 16 0 0 2 4 1 6 0 0 2 5 1 6 0 0 2 6 1 6 0 0 2 7 1 6 0 0 2 8 1 6 0 0 2 9 1 6 0 0 2 a 1 6 0 0 2 b 1 6 0 0 2 c 1 6 0 0 2 d 1 6 0 0 2 e 1 6 0 0 2 f 1 6 0030 16 0 0 3 1 1 6 0 0 3 2 1 6 0033 16 0 0 3 4 1 6 0 0 3 5 1 6 0036 16 0037 16 0 0 3 8 1 6 0039 16 003a 16 0 0 3 b 1 6 0 0 3 c 1 6 003d 16 0 0 3 e 1 6 0 0 3 f 1 6 0 0 0 0 1 6 0 0 0 1 1 6 0 0 0 2 1 6 0003 16 0 0 0 4 1 6 0 0 0 5 1 6 0 0 0 6 1 6 0 0 0 7 1 6 0 0 0 8 1 6 0 0 0 9 1 6 0 0 0 a 1 6 0 0 0 b 1 6 0 0 0 c 1 6 0 0 0 d 1 6 0 0 0 e 1 6 0 0 0 f 1 6 0010 16 0 0 1 1 1 6 0 0 1 2 1 6 0013 16 0 0 1 4 1 6 0 0 1 5 1 6 0016 16 0017 16 0 0 1 8 1 6 0019 16 001a 16 0 0 1 b 1 6 0 0 1 c 1 6 001d 16 0 0 1 e 1 6 0 0 1 f 1 6 p o r t p 0 ( p 0 ) p o r t p 0 d i r e c t i o n r e g i s t e r ( p 0 d ) p o r t p 1 ( p 1 ) p o r t p 1 d i r e c t i o n r e g i s t e r ( p 1 d ) p o r t p 2 ( p 2 ) p o r t p 2 d i r e c t i o n r e g i s t e r ( p 2 d ) port p3 (p3) p o r t p 3 d i r e c t i o n r e g i s t e r ( p 3 d ) p o r t p 4 ( p 4 ) p o r t p 4 d i r e c t i o n r e g i s t e r ( p 4 d ) t r a n s m i t / r e c e i v e b u f f e r r e g i s t e r ( t b / r b ) serial i/o1 status register (siosts) s e r i a l i / o 1 c o n t r o l r e g i s t e r ( s i o c o n ) u a r t c o n t r o l r e g i s t e r ( u a r t c o n ) b a u d r a t e g e n e r a t o r ( b r g ) interrupt control register 2 (icon2) a-d conversion low-order register (adl) prescaler y (prey) timer y (ty) a-d control register (adcon) a-d conversion high-order register (adh) interrupt edge selection register (intedge) cpu mode register (cpum) interrupt request register 1 (ireq1) interrupt request register 2 (ireq2) interrupt control register 1 (icon1) prescaler 12 (pre12) timer 2 (t2) prescaler x (prex) timer x (tx) timer 1 (t1) timer xy mode register (tm) reserved ? misrg watchdog timer control register (wdtcon) p w m c o n t r o l r e g i s t e r ( p w m c o n ) p w m p r e s c a l e r ( p r e p w m ) p w m r e g i s t e r ( p w m ) t i m e r c o u n t s o u r c e s e l e c t i o n r e g i s t e r ( t c s s ) serial i/o2 control register 1 (sio2con1) s e r i a l i / o 2 c o n t r o l r e g i s t e r 2 ( s i o 2 c o n 2 ) serial i/o2 register (sio2) ? r e s e r v e d : d o n o t w r i t e a n y d a t a t o t h i s a d d r e s s e s , b e c a u s e t h e s e a r e a s a r e r e s e r v e d . reserved ? reserved ? reserved ? reserved ? reserved ? reserved ? reserved ? r e s e r v e d ? reserved ? reserved ?
13 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers i/o ports the i/o ports have direction registers which determine the input/ output direction of each individual pin. each bit in a direction register corresponds to one pin, and each pin can be set to be input port or output port. when 0 is written to the bit corresponding to a pin, that pin becomes an input pin. when 1 is written to that bit, that pin becomes an output pin. if data is read from a pin which is set to output, the value of the port output latch is read, not the value of the pin itself. pins set to input are floating. if a pin set to input is written to, only the port output latch is written to and the pin remains floating. pin name input/output i/o structure non-port function table 7 i/o port function related sfrs port p0 port p1 port p2 p0 0 /s in2 p0 1 /s out2 p0 2 /s clk2 p0 3 /s rdy2 p0 4 p0 7 p1 0 p1 7 p2 0 /x cout p2 1 /x cin p2 2 p2 3 p2 4 /rxd p2 5 /txd p2 6 /s clk p2 7 /cntr 0 /s rdy1 p3 0 /an 0 p3 4 /an 4 p4 0 /cntr 1 p4 1 /int 0 p4 2 /int 1 p4 3 /int 2 /s cmp2 cmos compatible input level cmos 3-state output serial i/o2 function i/o serial i/o2 control register sub-clock generating circuit cpu mode register cmos compatible input level cmos 3-state output input/output, individual bits interrupt edge selection register pwm control register external interrupt input pwm output ref.no. (5) (1) (2) (3) (4) (6) (7) (8) (9) (10) (11) (17) cmos compatible input level n-channel open-drain output serial i/o1 control register serial i/o1 function i/o serial i/o1 function i/o timer x function i/o serial i/o1 control register timer xy mode register (12) timer y function i/o a-d conversion input a-d control register timer xy mode register (13) (14) (15) (16) interrupt edge selection register external interrupt input external interrupt input s cmp2 output interrupt edge selection register serial i/o2 control register p4 4 /int 3 /pwm port p3 port p4
14 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 10 port block diagram (1) p o r t l a t c h ( 1 ) p o r t p 0 0 ( 2 ) p o r t p 0 1 p0 1 /s out2 p-channel output disable bit p 0 2 / s c l k 2 p - c h a n n e l o u t p u t d i s a b l e b i t d i r e c t i o n r e g i s t e r port latch d i r e c t i o n r e g i s t e r port latch d i r e c t i o n r e g i s t e r p o r t l a t c h d i r e c t i o n r e g i s t e r port latch direction register d i r e c t i o n r e g i s t e r p o r t l a t c h direction register p o r t l a t c h direction register port latch data bus d a t a b u s data bus data bus data bus data bus s e r i a l i / o 2 i n p u t s e r i a l i / o 2 o u t p u t serial i/o2 transmit completion signal serial i/o2 port selection bit (3) port p0 2 s e r i a l i / o 2 s y n c h r o n o u s c l o c k s e l e c t i o n b i t serial i/o2 port selection bit s e r i a l i / o 2 c l o c k o u t p u t s e r i a l i / o 2 e x t e r n a l c l o c k i n p u t ( 4 ) p o r t p 0 3 s e r i a l i / o 2 r e a d y o u t p u t s rdy2 output enable bit (5) ports p0 4 -p0 7, p1 ( 6 ) p o r t p 2 0 port x c switch bit o s c i l l a t o r port x c switch bi t port p2 1 ( 7 ) p o r t p 2 1 p o r t x c s w i t c h b i t d a t a b u s s u b - c l o c k g e n e r a t i n g c i r c u i t i n p u t ( 8 ) p o r t s p 2 2 , p 2 3 data bus
15 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 11 port block diagram (2) port latch direction register data bus (9) port p2 4 port latch direction register data bus port latch direction register data bus port latch direction register data bus port latch direction register data bus port latch direction register data bus port latch direction register data bus port latch direction register data bus serial i/o1 enable bit receive enable bit serial i/o1 input (11) port p2 6 serial i/o1 synchronous clock selection bit serial i/o1 enable bit serial i/o1 enable bit serial i/o1 mode selection bit serial i/o1 clock output external clock input (13) ports p3 0 -p3 4 a-d converter input analog input pin selection bit (15) ports p4 1 ,p4 2 interrupt input (10) port p2 5 p-channel output disable bit serial i/o1 enable bit transmit enable bit serial i/o1 output (12) port p2 7 serial i/o1 enable bit serial i/o1 mode selection bit pulse output mode s rdy1 output enable bit timer output cntr 0 interrupt input serial ready output pulse output mode (14) port p4 0 timer output cntr 1 interrupt input pulse output mode (16) port p4 3 interru p t in p ut serial i/o2 i/o comparison signal control bit serial i/o2 i/o comparison signal output
16 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 12 port block diagram (3) (17) port p4 4 pwm output data bus pwm output enable bit interrupt input port latch direction register
17 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers interrupts interrupts occur by 15 sources among 15 sources: six external, eight internal, and one software. interrupt control each interrupt is controlled by an interrupt request bit, an interrupt enable bit, and the interrupt disable flag except for the software in- terrupt set by the brk instruction. an interrupt occurs if the corresponding interrupt request and enable bits are 1 and the in- terrupt disable flag is 0 . interrupt enable bits can be set or cleared by software. interrupt request bits can be cleared by software, but cannot be set by software. the brk instruction cannot be disabled with any flag or bit. the i (interrupt disable) flag disables all interrupts except the brk in- struction interrupt. when several interrupts occur at the same time, the interrupts are received according to priority. interrupt operation by acceptance of an interrupt, the following operations are auto- matically performed: 1. the contents of the program counter and the processor status register are automatically pushed onto the stack. 2. the interrupt disable flag is set and the corresponding interrupt request bit is cleared. 3. the interrupt jump destination address is read from the vector table into the program counter. notes when the active edge of an external interrupt (int 0 int 3 , cntr 0 , cntr 1 ) is set, the corresponding interrupt request bit may also be set. therefore, take the following sequence: 1. disable the interrupt 2. change the interrupt edge selection register (the timer xy mode register for cntr 0 and cntr 1 ) 3. clear the interrupt request bit to 0 4. accept the interrupt.
18 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers interrupt request generating conditions remarks interrupt source low fffc 16 high fffd 16 priority 1 table 8 interrupt vector addresses and priority notes 1: vector addresses contain interrupt jump destination addresses. 2: reset function in the same way as an interrupt with the highest priority. vector addresses (note 1) reset (note 2) int 0 reserved int 1 int 2 int 3 / serial i/o2 reserved timer x timer y timer 1 timer 2 serial i/o1 reception serial i/o1 transmission cntr 0 cntr 1 a-d converter brk instruction at reset at detection of either rising or falling edge of int 0 input at detection of either rising or falling edge of int 1 input at detection of either rising or falling edge of int 2 input at detection of either rising or falling edge of int 3 input/ at completion of serial i/o2 data reception/transmission reserved at completion of serial i/o1 data reception at completion of serial i/o1 transfer shift or when transmis- sion buffer is empty at timer x underflow at timer y underflow at timer 1 underflow at timer 2 underflow non-maskable external interrupt (active edge selectable) valid when serial i/o1 is selected valid when serial i/o1 is selected external interrupt (active edge selectable) stp release timer underflow external interrupt (active edge selectable) reserved at detection of either rising or falling edge of cntr 0 input at detection of either rising or falling edge of cntr 1 input at completion of a-d conversion at brk instruction execution external interrupt (active edge selectable) external interrupt (active edge selectable) external interrupt (active edge selectable) switch by serial i/o2/int 3 interrupt source bit fffa 16 fff8 16 fff6 16 fff4 16 fff2 16 fff0 16 ffee 16 ffec 16 ffea 16 ffe8 16 ffe6 16 ffe4 16 ffe2 16 ffe0 16 ffde 16 fffb 16 fff9 16 fff7 16 fff5 16 fff3 16 fff1 16 ffef 16 ffed 16 ffeb 16 ffe9 16 ffe7 16 ffe5 16 ffe3 16 ffe1 16 ffdf 16 ffdc 16 ffdd 16 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 non-maskable software interrupt
19 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 13 interrupt control fig. 14 structure of interrupt-related registers i n t e r r u p t d i s a b l e f l a g ( i ) i n t e r r u p t r e q u e s t i n t e r r u p t r e q u e s t b i t interrupt enable bit brk instruction rese t b 7 b 0 b 7 b 0 b7 b0 b7 b0 b7 b0 i n t e r r u p t e d g e s e l e c t i o n r e g i s t e r i n t 0 a c t i v e e d g e s e l e c t i o n b i t i n t 1 a c t i v e e d g e s e l e c t i o n b i t i n t 2 a c t i v e e d g e s e l e c t i o n b i t i n t 3 a c t i v e e d g e s e l e c t i o n b i t s e r i a l i / o 2 / i n t 3 i n t e r r u p t s o u r c e b i t 0 : i n t 3 i n t e r r u p t s e l e c t e d 1 : s e r i a l i / o 2 i n t e r r u p t s e l e c t e d n o t u s e d ( r e t u r n s 0 w h e n r e a d ) ( i n t e d g e : a d d r e s s 0 0 3 a 1 6 ) 0 : falling edge active 1 : rising edge active i n t e r r u p t r e q u e s t r e g i s t e r 1 i n t 0 i n t e r r u p t r e q u e s t b i t r e s e r v e d i n t 1 i n t e r r u p t r e q u e s t b i t i n t 2 i n t e r r u p t r e q u e s t b i t i n t 3 / s e r i a l i / o 2 i n t e r r u p t r e q u e s t b i t r e s e r v e d t i m e r x i n t e r r u p t r e q u e s t b i t t i m e r y i n t e r r u p t r e q u e s t b i t 0 : no interrupt request issued 1 : interrupt request issued ( i r e q 1 : a d d r e s s 0 0 3 c 1 6 ) interrupt request register 2 timer 1 interrupt request bit timer 2 interrupt request bit serial i/o1 reception interrupt request bit serial i/o1 transmit interrupt request bit cntr 0 interrupt request bit cntr 1 interrupt request bit ad converter interrupt request bit not used (returns 0 when read) (ireq2 : address 003d 16 ) 0 : n o i n t e r r u p t r e q u e s t i s s u e d 1 : i n t e r r u p t r e q u e s t i s s u e d interrupt control register 1 i n t 0 i n t e r r u p t e n a b l e b i t r e s e r v e d ( d o n o t w r i t e 1 t o t h i s b i t . ) i n t 1 i n t e r r u p t e n a b l e b i t i n t 2 i n t e r r u p t e n a b l e b i t i n t 3 / s e r i a l i / o 2 i n t e r r u p t e n a b l e b i t r e s e r v e d ( d o n o t w r i t e 1 t o t h i s b i t . ) t i m e r x i n t e r r u p t e n a b l e b i t t i m e r y i n t e r r u p t e n a b l e b i t ( i c o n 1 : a d d r e s s 0 0 3 e 1 6 ) i n t e r r u p t c o n t r o l r e g i s t e r 2 timer 1 interrupt enable bit timer 2 interrupt enable bit serial i/o1 reception interrupt enable bit serial i/o1 transmit interrupt enable bit cntr 0 interrupt enable bit cntr 1 interrupt enable bit ad converter interrupt enable bit not used (returns 0 when read) (do not write 1 to this bit.) 0 : i n t e r r u p t s d i s a b l e d 1 : i n t e r r u p t s e n a b l e d ( i c o n 2 : a d d r e s s 0 0 3 f 1 6 ) 0 : i n t e r r u p t s d i s a b l e d 1 : i n t e r r u p t s e n a b l e d
20 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers timers the 3850 group (spec. h) has four timers: timer x, timer y, timer 1, and timer 2. the division ratio of each timer or prescaler is given by 1/(n + 1), where n is the value in the corresponding timer or prescaler latch. all timers are count down. when the timer reaches 00 16 , an un- derflow occurs at the next count pulse and the corresponding timer latch is reloaded into the timer and the count is continued. when a timer underflows, the interrupt request bit corresponding to that timer is set to 1 . timer 1 and timer 2 the count source of prescaler 12 is the oscillation frequency which is selected by timer 12 count source selection bit. the out- put of prescaler 12 is counted by timer 1 and timer 2, and a timer underflow sets the interrupt request bit. timer x and timer y timer x and timer y can each select in one of four operating modes by setting the timer xy mode register. (1) timer mode the timer counts the count source selected by timer count source selection bit. (2) pulse output mode the timer counts the count source selected by timer count source selection bit. whenever the contents of the timer reach 00 16 , the signal output from the cntr 0 (or cntr 1 ) pin is inverted. if the cntr 0 (or cntr 1 ) active edge selection bit is 0 , output begins at h . if it is 1 , output starts at l . when using a timer in this mode, set the corresponding port p2 7 ( or port p4 0 ) direction register to out- put mode. (3) event counter mode operation in event counter mode is the same as in timer mode, except that the timer counts signals input through the cntr 0 or cntr 1 pin. when the cntr 0 (or cntr 1 ) active edge selection bit is 0 , the rising edge of the cntr 0 (or cntr 1 ) pin is counted. when the cntr 0 (or cntr 1 ) active edge selection bit is 1 , the falling edge of the cntr 0 (or cntr 1 ) pin is counted. (4) pulse width measurement mode if the cntr 0 (or cntr 1 ) active edge selection bit is 0 , the timer counts the selected signals by the count source selection bit while the cntr 0 (or cntr 1 ) pin is at h . if the cntr 0 (or cntr 1 ) ac- tive edge selection bit is 1 , the timer counts it while the cntr 0 (or cntr 1 ) pin is at l . the count can be stopped by setting 1 to the timer x (or timer y) count stop bit in any mode. the corresponding interrupt request bit is set each time a timer underflows. fig. 15 structure of timer xy mode register note when switching the count source by the timer 12, x and y count source bit, the value of timer count is altered in unconsiderable amount owing to generating of a thin pulses in the count input signals. therefore, select the timer count source before set the value to the prescaler and the timer. fig. 16 structure of timer count source selection register timer x count stop bit 0: count start 1: count stop t i m e r x y m o d e r e g i s t e r ( t m : a d d r e s s 0 0 2 3 1 6 ) timer y operating mode bits 0 0: timer mode 0 1: pulse output mode 1 0: event counter mode 1 1: pulse width measurement mode cntr 1 active edge selection bit 0: interrupt at falling edge count at rising edge in event counter mode 1: interrupt at rising edge count at falling edge in event counter mode b 7 cntr 0 active edge selection bit 0: interrupt at falling edge count at rising edge in event counter mode 1: interrupt at rising edge count at falling edge in event counter mode b 0 t i m e r x o p e r a t i n g m o d e b i t 0 0 : t i m e r m o d e 0 1 : p u l s e o u t p u t m o d e 1 0 : e v e n t c o u n t e r m o d e 1 1 : p u l s e w i d t h m e a s u r e m e n t m o d e b 1 b 0 b 5 b 4 timer y count stop bit 0: count start 1: count stop t i m e r c o u n t s o u r c e s e l e c t i o n r e g i s t e r ( t c s s : a d d r e s s 0 0 2 8 1 6 ) b 7 b0 t i m e r x c o u n t s o u r c e s e l e c t i o n b i t 0 : f ( x i n ) / 1 6 ( f ( x c i n ) / 1 6 a t l o w - s p e e d m o d e ) 1 : f ( x i n ) / 2 ( f ( x c i n ) / 2 a t l o w - s p e e d m o d e ) t i m e r y c o u n t s o u r c e s e l e c t i o n b i t 0 : f ( x i n ) / 1 6 ( f ( x c i n ) / 1 6 a t l o w - s p e e d m o d e ) 1 : f ( x i n ) / 2 ( f ( x c i n ) / 2 a t l o w - s p e e d m o d e ) timer 12 count source selection bit 0 : f(x in )/16 (f(x cin )/16 at low-speed mode) 1 : f(x cin ) not used (returns 0 when read)
21 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 17 block diagram of timer x, timer y, timer 1, and timer 2 q q 1 0 p 2 7 / c n t r 0 q q p4 0 /cntr 1 0 1 r r 1 0 0 1 t t prescaler x latch (8) p r e s c a l e r x ( 8 ) timer x latch (8) timer x (8) t o t i m e r x i n t e r r u p t r e q u e s t b i t t o g g l e f l i p - f l o p t i m e r x c o u n t s t o p b i t p u l s e w i d t h m e a s u r e m e n t m o d e e v e n t c o u n t e r m o d e t o c n t r 0 i n t e r r u p t r e q u e s t b i t pulse output mode p o r t p 2 7 l a t c h p o r t p 2 7 d i r e c t i o n r e g i s t e r c n t r 0 a c t i v e e d g e s e l e c t i o n b i t timer x latch write pulse pulse output mode t i m e r m o d e p u l s e o u t p u t m o d e prescaler y latch (8) prescaler y (8) timer y latch (8) timer y (8) t o t i m e r y i n t e r r u p t r e q u e s t b i t toggle flip-flop timer y count stop bit to cntr 1 interrupt request bit p u l s e o u t p u t m o d e port p4 0 latch port p4 0 direction register c n t r 1 a c t i v e e d g e s e l e c t i o n b i t t i m e r y l a t c h w r i t e p u l s e p u l s e o u t p u t m o d e timer mode pulse output mod e d a t a b u s data bu s prescaler 12 latch (8) prescaler 12 (8) timer 1 latch (8) timer 1 (8) data bus timer 2 latch (8) t i m e r 2 ( 8 ) to timer 2 interrupt request bit t o t i m e r 1 i n t e r r u p t r e q u e s t b i t c n t r 0 a c t i v e e d g e s e l e c t i o n b i t cntr 1 active edge selection bit p u l s e w i d t h m e a s u r e - m e n t m o d e event counter mode f ( x c i n ) t i m e r 1 2 c o u n t s o u r c e s e l e c t i o n b i t f(x in )/16 f ( x i n ) / 2 t i m e r y c o u n t s o u r c e s e l e c t i o n b i t f ( x i n ) / 1 6 f ( x i n ) / 2 t i m e r x c o u n t s o u r c e s e l e c t i o n b i t f ( x i n ) / 1 6 ( f ( x c i n ) / 1 6 a t l o w - s p e e d m o d e ) ( f ( x c i n ) / 2 a t l o w - s p e e d m o d e ) ( f ( x c i n ) / 1 6 a t l o w - s p e e d m o d e ) ( f ( x c i n ) / 2 a t l o w - s p e e d m o d e ) (f(x cin )/16 at low-speed mode)
22 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers serial i/o serial i/o1 serial i/o1 can be used as either clock synchronous or asynchro- nous (uart) serial i/o. a dedicated timer is also provided for baud rate generation. (1) clock synchronous serial i/o mode clock synchronous serial i/o mode can be selected by setting the serial i/o1 mode selection bit of the serial i/o1 control register (bit 6 of address 001a 16 ) to 1 . for clock synchronous serial i/o, the transmitter and the receiver must use the same clock. if an internal clock is used, transfer is started by a write signal to the tb/rb. fig. 18 block diagram of clock synchronous serial i/o1 fig. 19 operation of clock synchronous serial i/o1 function 1/4 1/4 f/f p2 6 /s clk serial i/o1 status register serial i/o1 control register p2 7 /s rdy1 p2 4 /r x d p2 5 /t x d x in receive buffer register address 0018 16 receive shift register receive buffer full flag (rbf) receive interrupt request (ri) clock control circuit shift clock serial i/o1 synchronous clock selection bit frequency division ratio 1/(n+1) baud rate generator address 001c 16 brg count source selection bit clock control circuit falling-edge detector transmit buffer register data bus address 0018 16 shift clock transmit shift completion flag (tsc) transmit buffer empty flag (tbe) transmit interrupt request (ti) transmit interrupt source selection bit address 0019 16 data bus address 001a 16 transmit shift register d 7 d 7 d 0 d 1 d 2 d 3 d 4 d 5 d 6 d 0 d 1 d 2 d 3 d 4 d 5 d 6 rbf = 1 tsc = 1 tbe = 0 tbe = 1 tsc = 0 transfer shift clock (1/2 to 1/2048 of the internal clock, or an external clock) serial output txd serial input rxd write pulse to receive/transmit buffer register (address 0018 16 ) overrun error (oe) detection notes 1: as the transmit interrupt (ti), either when the transmit buffer has emptied (tbe=1) or after the transmit shift operation has ended (tsc=1), by setting the transmit interrupt source selection bit (tic) of the serial i/o1 control register. 2: if data is written to the transmit buffer register when tsc=0, the transmit clock is generated continuously and serial data is output continuously from the txd pin. 3: the receive interrupt (ri) is set when the receive buffer full flag (rbf) becomes 1 . receive enable signal s rdy1
23 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers (2) asynchronous serial i/o (uart) mode clock asynchronous serial i/o mode (uart) can be selected by clearing the serial i/o1 mode selection bit (b6) of the serial i/o1 control register to 0 . eight serial data transfer formats can be selected, and the transfer formats used by a transmitter and receiver must be identical. the transmit and receive shift registers each have a buffer, but the two buffers have the same address in memory. since the shift reg- ister cannot be written to or read from directly, transmit data is written to the transmit buffer register, and receive data is read from the receive buffer register. the transmit buffer register can also hold the next data to be transmitted, and the receive buffer register can hold a character while the next character is being received. fig. 20 block diagram of uart serial i/o1 x i n 1 / 4 o e p ef e 1 / 1 6 1 / 1 6 d a t a b u s r e c e i v e b u f f e r r e g i s t e r a d d r e s s 0 0 1 8 1 6 receive shift register r e c e i v e b u f f e r f u l l f l a g ( r b f ) r e c e i v e i n t e r r u p t r e q u e s t ( r i ) baud rate generator f r e q u e n c y d i v i s i o n r a t i o 1 / ( n + 1 ) address 001c 16 s t / s p / p a g e n e r a t o r transmit buffer register d a t a b u s t r a n s m i t s h i f t r e g i s t e r address 0018 16 transmit shift completion flag (tsc) t r a n s m i t b u f f e r e m p t y f l a g ( t b e ) transmit interrupt request (ti) address 0019 16 st detector sp detector uart control register a d d r e s s 0 0 1 b 1 6 c h a r a c t e r l e n g t h s e l e c t i o n b i t a d d r e s s 0 0 1 a 1 6 b r g c o u n t s o u r c e s e l e c t i o n b i t transmit interrupt source selection bit serial i/o1 synchronous clock selection bit clock control circuit c h a r a c t e r l e n g t h s e l e c t i o n b i t 7 bits 8 b i t s serial i/o1 control register p 2 6 / s c l k serial i/o1 status register p 2 4 / r x d p 2 5 / t x d
24 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 21 operation of uart serial i/o1 function [transmit buffer register/receive buffer register (tb/rb)] 0018 16 the transmit buffer register and the receive buffer register are lo- cated at the same address. the transmit buffer is write-only and the receive buffer is read-only. if a character bit length is 7 bits, the msb of data stored in the receive buffer is 0 . [serial i/o1 status register (siosts)] 0019 16 the read-only serial i/o1 status register consists of seven flags (bits 0 to 6) which indicate the operating status of the serial i/o1 function and various errors. three of the flags (bits 4 to 6) are valid only in uart mode. the receive buffer full flag (bit 1) is cleared to 0 when the receive buffer register is read. if there is an error, it is detected at the same time that data is transferred from the receive shift register to the receive buffer reg- ister, and the receive buffer full flag is set. a write to the serial i/o1 status register clears all the error flags oe, pe, fe, and se (bit 3 to bit 6, respectively). writing 0 to the serial i/o1 enable bit sioe (bit 7 of the serial i/o1 control register) also clears all the status flags, including the error flags. bits 0 to 6 of the serial i/o1 status register are initialized to 0 at reset, but if the transmit enable bit (bit 4) of the serial i/o1 control register has been set to 1 , the transmit shift completion flag (bit 2) and the transmit buffer empty flag (bit 0) become 1 . [serial i/o1 control register (siocon)] 001a 16 the serial i/o1 control register consists of eight control bits for the serial i/o1 function. [uart control register (uartcon)] 001b 16 the uart control register consists of four control bits (bits 0 to 3) which are valid when asynchronous serial i/o is selected and set the data format of an data transfer and one bit (bit 4) which is al- ways valid and sets the output structure of the p2 5 /t x d pin. [baud rate generator (brg)] 001c 16 the baud rate generator determines the baud rate for serial trans- fer. the baud rate generator divides the frequency of the count source by 1/(n + 1), where n is the value written to the baud rate genera- tor. tsc=0 tbe=1 rbf=0 tbe=0 tbe=0 rbf=1 rbf=1 st d 0 d 1 sp d 0 d 1 st sp tbe=1 tsc=1 st d 0 d 1 sp d 0 d 1 st sp transmit or receive clock transmit buffer write signal generated at 2nd bit in 2-stop-bit mode 1 start bit 7 or 8 data bit 1 or 0 parity bit 1 or 2 stop bit (s) 1: error flag detection occurs at the same time that the rbf flag becomes 1 (at 1st stop bit, during reception). 2: as the transmit interrupt (ti), when either the tbe or tsc flag becomes 1, can be selected to occur depending on the setting of the transmit interrupt source selection bit (tic) of the serial i/o1 control register. 3: the receive interrupt (ri) is set when the rbf flag becomes 1. 4: after data is written to the transmit buffer when tsc=1, 0.5 to 1.5 cycles of the data shift cycle is necessary until changing to tsc=0. notes serial output t x d serial input r x d receive buffer read signal
25 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers b 7 t r a n s m i t b u f f e r e m p t y f l a g ( t b e ) 0 : b u f f e r f u l l 1 : b u f f e r e m p t y r e c e i v e b u f f e r f u l l f l a g ( r b f ) 0 : b u f f e r e m p t y 1 : b u f f e r f u l l t r a n s m i t s h i f t c o m p l e t i o n f l a g ( t s c ) 0 : t r a n s m i t s h i f t i n p r o g r e s s 1 : t r a n s m i t s h i f t c o m p l e t e d o v e r r u n e r r o r f l a g ( o e ) 0 : n o e r r o r 1 : o v e r r u n e r r o r p a r i t y e r r o r f l a g ( p e ) 0 : n o e r r o r 1 : p a r i t y e r r o r f r a m i n g e r r o r f l a g ( f e ) 0 : n o e r r o r 1 : f r a m i n g e r r o r s u m m i n g e r r o r f l a g ( s e ) 0 : ( o e ) u ( p e ) u ( f e ) = 0 1 : ( o e ) u ( p e ) u ( f e ) = 1 n o t u s e d ( r e t u r n s 1 w h e n r e a d ) s e r i a l i / o 1 s t a t u s r e g i s t e r s e r i a l i / o 1 c o n t r o l r e g i s t e r b 7 b 0 b 0 b r g c o u n t s o u r c e s e l e c t i o n b i t ( c s s ) 0 : f ( x i n ) 1 : f ( x i n ) / 4 s e r i a l i / o 1 s y n c h r o n o u s c l o c k s e l e c t i o n b i t ( s c s ) 0 : b r g o u t p u t d i v i d e d b y 4 w h e n c l o c k s y n c h r o n o u s s e r i a l i / o 1 i s s e l e c t e d , b r g o u t p u t d i v i d e d b y 1 6 w h e n u a r t i s s e l e c t e d . 1 : e x t e r n a l c l o c k i n p u t w h e n c l o c k s y n c h r o n o u s s e r i a l i / o 1 i s s e l e c t e d , e x t e r n a l c l o c k i n p u t d i v i d e d b y 1 6 w h e n u a r t i s s e l e c t e d . s r d y 1 o u t p u t e n a b l e b i t ( s r d y ) 0 : p 2 7 p i n o p e r a t e s a s o r d i n a r y i / o p i n 1 : p 2 7 p i n o p e r a t e s a s s r d y 1 o u t p u t p i n t r a n s m i t i n t e r r u p t s o u r c e s e l e c t i o n b i t ( t i c ) 0 : i n t e r r u p t w h e n t r a n s m i t b u f f e r h a s e m p t i e d 1 : i n t e r r u p t w h e n t r a n s m i t s h i f t o p e r a t i o n i s c o m p l e t e d t r a n s m i t e n a b l e b i t ( t e ) 0 : t r a n s m i t d i s a b l e d 1 : t r a n s m i t e n a b l e d r e c e i v e e n a b l e b i t ( r e ) 0 : r e c e i v e d i s a b l e d 1 : r e c e i v e e n a b l e d s e r i a l i / o 1 m o d e s e l e c t i o n b i t ( s i o m ) 0 : c l o c k a s y n c h r o n o u s ( u a r t ) s e r i a l i / o 1 : c l o c k s y n c h r o n o u s s e r i a l i / o s e r i a l i / o 1 e n a b l e b i t ( s i o e ) 0 : s e r i a l i / o 1 d i s a b l e d ( p i n s p 2 4 t o p 2 7 o p e r a t e a s o r d i n a r y i / o p i n s ) 1 : s e r i a l i / o 1 e n a b l e d ( p i n s p 2 4 t o p 2 7 o p e r a t e a s s e r i a l i / o 1 p i n s ) b 7 uart control register c h a r a c t e r l e n g t h s e l e c t i o n b i t ( c h a s ) 0 : 8 b i t s 1 : 7 b i t s p a r i t y e n a b l e b i t ( p a r e ) 0 : p a r i t y c h e c k i n g d i s a b l e d 1 : p a r i t y c h e c k i n g e n a b l e d p a r i t y s e l e c t i o n b i t ( p a r s ) 0 : e v e n p a r i t y 1 : o d d p a r i t y s t o p b i t l e n g t h s e l e c t i o n b i t ( s t p s ) 0 : 1 s t o p b i t 1 : 2 s t o p b i t s p 2 5 / t x d p - c h a n n e l o u t p u t d i s a b l e b i t ( p o f f ) 0 : c m o s o u t p u t ( i n o u t p u t m o d e ) 1 : n - c h a n n e l o p e n d r a i n o u t p u t ( i n o u t p u t m o d e ) n o t u s e d ( r e t u r n 1 w h e n r e a d ) b 0 ( s i o s t s : a d d r e s s 0 0 1 9 1 6 ) ( s i o c o n : a d d r e s s 0 0 1 a 1 6 ) (uartcon : address 001b 16 ) fig. 22 structure of serial i/o1 control registers
26 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers serial i/o2 the serial i/o2 can be operated only as the clock synchronous type. as a synchronous clock for serial transfer, either internal clock or external clock can be selected by the serial i/o2 synchronous clock selection bit (b6) of serial i/o2 control register 1. the internal clock incorporates a dedicated divider and permits se- lecting 6 types of clock by the internal synchronous clock selection bits (b2, b1, b0) of serial i/o2 control register 1. regarding s out2 and s clk2 being output pins, either cmos output format or n-channel open-drain output format can be selected by the p0 1 /s out2 , p0 2 /s clk2 p-channel output disable bit (b7) of serial i/o2 control register 1. when the internal clock has been selected, a transfer starts by a write signal to the serial i/o2 register (address 0017 16 ). after comple- tion of data transfer, the level of the s out2 pin goes to high imped- ance automatically but bit 7 of the serial i/o2 control register 2 is not set to 1 automatically. when the external clock has been selected, the contents of the serial i/o2 register is continuously sifted while transfer clocks are input. accordingly, control the clock externally. note that the s out2 pin does not go to high impedance after completion of data transfer. to cause the s out2 pin to go to high impedance in the case where the external clock is selected, set bit 7 of the serial i/o2 control reg- ister 2 to 1 when s clk2 is h after completion of data transfer. after the next data transfer is started (the transfer clock falls), bit 7 of the serial i/o2 control register 2 is set to 0 and the s out2 pin is put into the active state. regardless of the internal clock to external clock, the interrupt re- quest bit is set after the number of bits (1 to 8 bits) selected by the optional transfer bit is transferred. in case of a fractional number of bits less than 8 bits as the last data, the received data to be stored in the serial i/o2 register becomes a fractional number of bits close to msb if the transfer direction selection bit of serial i/o2 control regis- ter 1 is lsb first, or a fractional number of bits close to lsb if the said bit is msb first. for the remaining bits, the previously received data is shifted. at transmit operation using the clock synchronous serial i/o, the s cmp2 signal can be output by comparing the state of the transmit pin s out2 with the state of the receive pin s in2 in synchronization with a rise of the transfer clock. if the output level of the s out2 pin is equal to the input level to the s in2 pin, l is output from the s cmp2 pin. if not, h is output. at this time, an int 2 interrupt request can also be gener- ated. select a valid edge by bit 2 of the interrupt edge selection reg- ister (address 003a 16 ). [serial i/o2 control registers 1, 2 (sio2con1 / sio2con2)] 0015 16, 0016 16 the serial i/o2 control registers 1 and 2 are containing various se- lection bits for serial i/o2 control as shown in figure 23. fig. 23 structure of serial i/o2 control registers 1, 2 s e r i a l i / o 2 c o n t r o l r e g i s t e r 1 ( s i o 2 c o n 1 : a d d r e s s 0 0 1 5 1 6 ) s e r i a l i / o 2 c o n t r o l r e g i s t e r 2 ( s i o 2 c o n 2 : a d d r e s s 0 0 1 6 1 6 ) b7 b0 o p t i o n a l t r a n s f e r b i t s b 2 b 1 b 0 0 0 0 : 1 b i t 0 0 1 : 2 b i t 0 1 0 : 3 b i t 0 1 1 : 4 b i t 1 0 0 : 5 b i t 1 0 1 : 6 b i t 1 1 0 : 7 b i t 1 1 1 : 8 b i t n o t u s e d ( r e t u r n s " 0 " w h e n r e a d ) s e r i a l i / o 2 i / o c o m p a r i s o n s i g n a l c o n t r o l b i t 0 : p 4 3 i / o 1 : s c m p 2 o u t p u t s o u t 2 p i n c o n t r o l b i t ( p 0 1 ) 0 : o u t p u t a c t i v e 1 : o u t p u t h i g h - i m p e d a n c e internal synchronous clock selection bits b2 b1 b0 0 0 0: f(x in )/8 (f(x cin )/8 in low-speed mode) 0 0 1: f(x in )/16 (f(x cin )/16 in low-speed mode) 0 1 0: f(x in )/32 (f(x cin )/32 in low-speed mode) 0 1 1: f(x in )/64 (f(x cin )/64 in low-speed mode) 1 1 0: f(x in )/128 f(x cin )/128 in low-speed mode) 1 1 1: f(x in )/256 (f(x cin )/256 in low-speed mode) serial i/o2 port selection bit 0: i/o port 1: s out2 ,s clk2 output pin s rdy2 output enable bit 0: p0 3 pin is normal i/o pin 1: p0 3 pin is s rdy2 output pin transfer direction selection bit 0: lsb first 1: msb first serial i/o2 synchronous clock selection bit 0: external clock 1: internal clock p0 1 /s out2 , p0 2 /s clk2 p-channel output disable bit 0: cmos output (in output mode) 1: n-channel open-drain output (in output mode ) b 7 b 0
27 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 24 block diagram of serial i/o2 fig. 25 timing chart of serial i/o2 x in 1 0 0 1 0 1 s r d y 2 s c l k 2 0 1 1/8 1/16 1/32 1/64 1/128 1/256 1 0 x cin 10 0 0 0 1 data bus s e r i a l i / o 2 i n t e r r u p t r e q u e s t serial i/o2 port selection bit serial i/o counter 2 (3) serial i/o2 register (8) s y n c h r o n o u s c i r c u i t serial i/o2 port selection bit s e r i a l i / o 2 s y n c h r o n o u s c l o c k s e l e c t i o n b i t s r d y 2 o u t p u t e n a b l e b i t external clock i n t e r n a l s y n c h r o n o u s c l o c k s e l e c t i o n b i t s d i v i d e r optional transfer bits (3) p 0 2 / s c l k 2 p0 1 /s out2 p 0 0 / s i n 2 p 0 2 l a t c h p 0 1 l a t c h p 0 3 l a t c h p 0 3 / s r d y 2 p 4 3 / s c m p 2 / i n t 2 serial i/o2 i/o comparison signal control bit p4 3 latch q d m a i n c l o c k d i v i s i o n r a t i o s e l e c t i o n b i t s ( n o t e ) n o t e : e i t h e r h i g h - s p e e d , m i d d l e - s p e e d o r l o w - s p e e d m o d e i s s e l e c t e d b y b i t s 6 a n d 7 o f c p u m o d e r e g i s t e r . d 7 d 0 d 1 d 2 d 3 d 4 d 5 d 6 t r a n s f e r c l o c k ( n o t e 1 ) s e r i a l i / o 2 o u t p u t s o u t 2 s e r i a l i / o 2 i n p u t s i n 2 r e c e i v e e n a b l e s i g n a l s r d y 2 w r i t e - i n s i g n a l t o s e r i a l i / o 2 r e g i s t e r (note 2) serial i/o2 interrupt request bit set . 1 : w h e n t h e i n t e r n a l c l o c k i s s e l e c t e d a s a t r a n s f e r c l o c k , t h e f ( x i n ) c l o c k d i v i s i o n ( f ( x c i n ) i n l o w - s p e e d m o d e ) c a n b e s e l e c t e d b y s e t t i n g b i t s 0 t o 2 o f s e r i a l i / o 2 c o n t r o l r e g i s t e r 1 . 2 : w h e n t h e i n t e r n a l c l o c k i s s e l e c t e d a s a t r a n s f e r c l o c k , t h e s o u t 2 p i n h a s h i g h i m p e d a n c e a f t e r t r a n s f e r c o m p l e t i o n . n o t e s
28 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 26 s cmp2 output operation s clk2 s in2 s out2 s cmp2 judgement of i/o data comparison
29 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers pulse width modulation (pwm) the 3850 group (spec. h) has a pwm function with an 8-bit resolution, based on a signal that is the clock input x in or that clock input divided by 2. data setting the pwm output pin also functions as port p4 4 . set the pwm period by the pwm prescaler, and set the h term of output pulse by the pwm register. if the value in the pwm prescaler is n and the value in the pwm register is m (where n = 0 to 255 and m = 0 to 255) : pwm period = 255 ? (n+1) / f(x in ) = 31.875 ? (n+1) s (when f(x in ) = 8 mhz,count source selection bit = 0 ) output pulse h term = pwm period ? m / 255 = 0.125 ? (n+1) ? m s (when f(x in ) = 8 mhz,count source selection bit = 0 ) fig. 27 timing of pwm period fig. 28 block diagram of pwm function pwm operation when bit 0 (pwm enable bit) of the pwm control register is set to 1 , operation starts by initializing the pwm output circuit, and pulses are output starting at an h . if the pwm register or pwm prescaler is updated during pwm output, the pulses will change in the cycle after the one in which the change was made. 3 1 . 8 7 5 ? m ? ( n + 1 ) 2 5 5 s t = [ 3 1 . 8 7 5 ? ( n + 1 ) ] s p w m o u t p u t m : c o n t e n t s o f p w m r e g i s t e r n : c o n t e n t s o f p w m p r e s c a l e r t : p w m p e r i o d ( w h e n f ( x i n ) = 8 m h z , c o u n t s o u r c e s e l e c t i o n b i t = 0 ) data bus count source selection bit 0 1 pwm prescaler pre-latch p w m r e g i s t e r p r e - l a t c h pwm prescaler latch pwm register latch transfer control circuit pwm register 1/2 x i n port p4 4 latch p w m e n a b l e b i t port p4 4 p w m p r e s c a l e r (x cin at low-speed mode)
30 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 29 structure of pwm control register fig. 30 pwm output timing when pwm register or pwm prescaler is changed note the pwm starts after the pwm function enable bit is set to enable and l level is output from the pwm pin. the length of this l level output is as follows: sec (count source selection bit = 0, where n is the value set in the prescaler) sec (count source selection bit = 1, where n is the value set in the prescaler) n+1 2 f(x in ) n+1 f(x in ) p w m c o n t r o l r e g i s t e r ( p w m c o n : a d d r e s s 0 0 1 d 1 6 ) p w m f u n c t i o n e n a b l e b i t c o u n t s o u r c e s e l e c t i o n b i t n o t u s e d ( r e t u r n 0 w h e n r e a d ) b 7 b 0 0 : p w m d i s a b l e d 1 : p w m e n a b l e d 0 : f ( x i n ) ( f ( x c i n ) a t l o w - s p e e d m o d e ) 1 : f ( x i n ) / 2 ( f ( x c i n ) / 2 a t l o w - s p e e d m o d e ) abc b t c t 2 = pwm output p w m r e g i s t e r w r i t e s i g n a l pwm prescaler write signal ( c h a n g e s h t e r m f r o m a t o b . ) (changes pwm period from t to t2 .) when the contents of the pwm register or pwm prescaler have changed, the pwm output will change from the next period after the change. t t t2
31 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers a-d converter [a-d conversion registers (adl, adh)] 0035 16 , 0036 16 the a-d conversion registers are read-only registers that store the result of an a-d conversion. do not read these registers during an a-d conversion. [ad control register (adcon)] 0034 16 the ad control register controls the a-d conversion process. bits 0 to 2 select a specific analog input pin. bit 4 indicates the completion of an a-d conversion. the value of this bit remains at 0 during an a-d conversion and changes to 1 when an a-d conversion ends. writing 0 to this bit starts the a-d conversion. comparison voltage generator the comparison voltage generator divides the voltage between av ss and v ref into 1024 and outputs the divided voltages. channel selector the channel selector selects one of ports p3 0 /an 0 to p3 4 /an 4 and inputs the voltage to the comparator. comparator and control circuit the comparator and control circuit compare an analog input volt- age with the comparison voltage, and the result is stored in the a-d conversion registers. when an a-d conversion is completed, the control circuit sets the a-d conversion completion bit and the a-d interrupt request bit to 1 . note that because the comparator consists of a capacitor cou- pling, set f(x in ) to 500 khz or more during an a-d conversion. when the a-d converter is operated at low-speed mode, f(x in ) and f(x cin ) do not have the lower limit of frequency, because of the a-d converter has a built-in self-oscillation circuit. fig. 31 structure of ad control register fig. 32 structure of a-d conversion registers fig. 33 block diagram of a-d converter c h a n n e l s e l e c t o r a - d c o n t r o l c i r c u i t a-d conversion low-order register resistor ladder v ref av ss c o m p a r a t o r a - d i n t e r r u p t r e q u e s t b 7b 0 3 10 p 3 0 / a n 0 p 3 1 / a n 1 p 3 2 / a n 2 p 3 3 / a n 3 p 3 4 / a n 4 d a t a b u s a d c o n t r o l r e g i s t e r a-d conversion high-order register ( a d d r e s s 0 0 3 4 1 6 ) (address 0036 16 ) (address 0035 16 ) a d c o n t r o l r e g i s t e r ( a d c o n : a d d r e s s 0 0 3 4 1 6 ) a n a l o g i n p u t p i n s e l e c t i o n b i t s 0 0 0 : p 3 0 / a n 0 0 0 1 : p 3 1 / a n 1 0 1 0 : p 3 2 / a n 2 0 1 1 : p 3 3 / a n 3 1 0 0 : p 3 4 / a n 4 n o t u s e d ( r e t u r n s 0 w h e n r e a d ) a - d c o n v e r s i o n c o m p l e t i o n b i t 0 : c o n v e r s i o n i n p r o g r e s s 1 : c o n v e r s i o n c o m p l e t e d n o t u s e d ( r e t u r n s 0 w h e n r e a d ) b 7 b0 b 2 b 1 b 0 10-bit reading (read address 0036 16 before 0035 16 ) (address 0036 16 ) (address 0035 16 ) 8-bit reading (read only address 0035 16 ) (address 0035 16 ) b 8 b7 b 6b5b 4 b 3b 2b 1b 0 b7 b 0 b 9 b 7 b 0 note : the high-order 6 bits of address 0036 16 become 0 at reading. b9 b8 b7 b 6 b5 b4 b 3 b 2 b7 b 0
32 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers watchdog timer the watchdog timer gives a mean of returning to the reset status when a program cannot run on a normal loop (for example, be- cause of a software run-away). the watchdog timer consists of an 8-bit watchdog timer l and an 8-bit watchdog timer h. standard operation of watchdog timer when any data is not written into the watchdog timer control reg- ister (address 0039 16 ) after reset, the watchdog timer is in the stop state. the watchdog timer starts to count down by writing an optional value into the watchdog timer control register (address 0039 16 ) and an internal reset occurs at an underflow of the watch- dog timer h. accordingly, programming is usually performed so that writing to the watchdog timer control register (address 0039 16 ) may be started before an underflow. when the watchdog timer control reg- ister (address 0039 16 ) is read, the values of the high-order 6 bits of the watchdog timer h, stp instruction disable bit, and watch- dog timer h count source selection bit are read. initial value of watchdog timer at reset or writing to the watchdog timer control register (address 0039 16 ), each watchdog timer h and l is set to ff 16 . fig. 35 structure of watchdog timer control register watchdog timer h count source selection bit operation bit 7 of the watchdog timer control register (address 0039 16 ) per- mits selecting a watchdog timer h count source. when this bit is set to 0 , the count source becomes the underflow signal of watchdog timer l. the detection time is set to 131.072 ms at f(x in ) = 8 mhz frequency and 32.768 s at f(x cin ) = 32 khz frequency. when this bit is set to 1 , the count source becomes the signal divided by 16 for f(x in ) (or f(x cin )). the detection time in this case is set to 512 s at f(x in ) = 8 mhz frequency and 128 ms at f(x cin ) = 32 khz frequency. this bit is cleared to 0 after reset. operation of stp instruction disable bit bit 6 of the watchdog timer control register (address 0039 16 ) per- mits disabling the stp instruction when the watchdog timer is in operation. when this bit is 0 , the stp instruction is enabled. when this bit is 1 , the stp instruction is disabled, once the stp instruction is executed, an internal reset occurs. when this bit is set to 1 , it cannot be rewritten to 0 by program. this bit is cleared to 0 after reset. fig. 34 block diagram of watchdog timer x i n data bus x c i n 1 0 0 0 0 1 m a i n c l o c k d i v i s i o n r a t i o s e l e c t i o n b i t s ( n o t e ) 0 1 1 / 1 6 watchdog timer h count source selection bit r e s e t c i r c u i t s t p i n s t r u c t i o n d i s a b l e b i t w a t c h d o g t i m e r h ( 8 ) ff 16 is set when watchdog timer control register is written to. internal reset r e s e t watchdog timer l (8) note: any one of high-speed, middle-speed or low-speed mode is selected by bits 7 and 6 of the cpu mode register. s t p i n s t r u c t i o n ff 16 is set when watchdog timer control register is written to. b 0 stp instruction disable bit 0: stp instruction enabled 1: stp instruction disabled w a t c h d o g t i m e r h c o u n t s o u r c e s e l e c t i o n b i t 0 : w a t c h d o g t i m e r l u n d e r f l o w 1 : f ( x i n ) / 1 6 o r f ( x c i n ) / 1 6 w a t c h d o g t i m e r h ( f o r r e a d - o u t o f h i g h - o r d e r 6 b i t ) watchdog timer control register (wdtcon : address 0039 16 ) b 7
33 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers reset circuit to reset the microcomputer, reset pin must be held at an l level for 20 cycles or more of x in . then the reset pin is returned to an h level (the power source voltage must be between 2.7 v and 5.5 v, and the oscillation must be stable), reset is released. after the reset is completed, the program starts from the address contained in address fffd 16 (high-order byte) and address fffc 16 (low-order byte). make sure that the reset input voltage is less than 0.54 v for v cc of 2.7 v. fig. 37 reset sequence fig. 36 reset circuit example ( n o t e ) 0 . 2 v c c 0 v 0v p o w e r o n v c c r e s e t v c c r e s e t p o w e r s o u r c e v o l t a g e d e t e c t i o n c i r c u i t p o w e r s o u r c e v o l t a g e reset input voltage n o t e : r e s e t r e l e a s e v o l t a g e ; v c c = 2 . 7 v r e s e t d a t a a d d r e s s s y n c x i n : 8 t o 1 3 c l o c k c y c l e s x i n ? ? ? ? ? f f f c fffd ad h , l ? ? ? ? ? a d l ad h 1 : t h e f r e q u e n c y r e l a t i o n o f f ( x i n ) a n d f ( ) i s f ( x i n ) = 2 f ( ) . 2 : t h e q u e s t i o n m a r k s ( ? ) i n d i c a t e a n u n d e f i n e d s t a t e t h a t d e p e n d s o n t h e p r e v i o u s s t a t e . 3 : a l l s i g n a l s e x c e p t x i n a n d r e s e t a r e i n t e r n a l s . r e s e t a d d r e s s f r o m t h e v e c t o r t a b l e . n o t e s r e s e t o u t
34 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 38 internal status at reset note : x : not fixed since the initial values for other than above mentioned registers and ram contents are indefinite at reset, they must be set. (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) (16) (17) (18) (19) (20) (21) (22) (23) (24) (25) (26) (27) (28) (29) (30) (31) (32) (33) address register contents 00 16 00 16 00 16 00 16 00 16 00 16 00 16 00 16 00 16 00 16 00 16 00 16 00 16 ff 16 01 16 00 16 00 16 ff 16 ff 16 ff 16 ff 16 00 16 port p0 (p0) port p0 direction register (p0d) port p1 (p1) port p1 direction register (p1d) port p2 (p2) port p2 direction register (p2d) port p3 (p3) port p3 direction register (p3d) port p4 (p4) port p4 direction register (p4d) serial i/o2 control register 1 (sio2con1) serial i/o2 control register 2 (sio2con2) serial i/o2 register (sio2) transmit/receive buffer register (tb/rb) serial i/o1 status register (siosts) serial i/o1 control register (siocon) uart control register (uartcon) baud rate generator (brg) pwm control register (pwmcon) pwm prescaler (prepwm) pwm register (pwm) prescaler 12 (pre12) timer 1 (t1) timer 2 (t2) timer xy mode register (tm) prescaler x (prex) timer x (tx) prescaler y (prey) timer y (ty) timer count source selection register (tcss) a-d control register (adcon) a-d conversion low-order register (adl) a-d conversion high-order register (adh) 0000 0111 1000 0000 xxxxxxxx 0000 16 0001 16 0002 16 0003 16 0004 16 0005 16 0006 16 0007 16 0008 16 0009 16 0015 16 0016 16 0017 16 0018 16 0019 16 001a 16 001b 16 001c 16 001d 16 001e 16 001f 16 0020 16 0021 16 0022 16 0023 16 0024 16 0025 16 0026 16 0027 16 0028 16 0034 16 0035 16 0036 16 1110 0000 xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 00010000 xxxxxxxx xx 00 16 00 16 00 16 00 16 00 16 00 16 (34) (35) (36) (37) (38) (39) (40) (41) (42) (43) register contents 0038 16 0039 16 003a 16 003b 16 003c 16 003d 16 003e 16 003f 16 (ps) (pc h ) (pc l ) address xxxxx1xx fffd 16 contents fffc 16 contents 0011 1111 0100 10 00 misrg watchdog timer control register (wdtcon) interrupt edge selection register (intedge) cpu mode register (cpum) interrupt request register 1 (ireq1) interrupt request register 2 (ireq2) interrupt control register 1 (icon1) interrupt control register 2 (icon2) processor status register program counter 000000
35 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers clock generating circuit the 3850 group (spec. h) has two built-in oscillation circuits. an oscillation circuit can be formed by connecting a resonator be- tween x in and x out (x cin and x cout ). use the circuit constants in accordance with the resonator manufacturer s recommended values. no external resistor is needed between x in and x out since a feed-back resistor exists on-chip. however, an external feed-back resistor is needed between x cin and x cout . immediately after power on, only the x in oscillation circuit starts oscillating, and x cin and x cout pins function as i/o ports. frequency control (1) middle-speed mode the internal clock is the frequency of x in divided by 8. after re- set, this mode is selected. (2) high-speed mode the internal clock is half the frequency of x in . (3) low-speed mode the internal clock is half the frequency of x cin . note if you switch the mode between middle/high-speed and low- speed, stabilize both x in and x cin oscillations. the sufficient time is required for the sub-clock to stabilize, especially immediately af- ter power on and at returning from the stop mode. when switching the mode between middle/high-speed and low-speed, set the fre- quency on condition that f(x in ) > 3 f(x cin ). (4) low power dissipation mode the low power consumption operation can be realized by stopping the main clock x in in low-speed mode. to stop the main clock, set bit 5 of the cpu mode register to 1. when the main clock x in is restarted (by setting the main clock stop bit to 0 ), set sufficient time for oscillation to stabilize. the sub-clock x cin -x cout oscillating circuit can not directly input clocks that are generated externally. accordingly, make sure to cause an external resonator to oscillate. oscillation control (1) stop mode if the stp instruction is executed, the internal clock stops at an h level, and x in and x cin oscillation stops. when the oscillation stabilizing time set after stp instruction released bit is 0, the prescaler 12 is set to ff 16 and timer 1 is set to 01 16 . when the oscillation stabilizing time set after stp instruction released bit is 1, set the sufficient time for oscillation of used oscillator to stabi- lize since nothing is set to the prescaler 12 and timer 1. either x in or x cin divided by 16 is input to the prescaler 12 as count source. oscillator restarts when an external interrupt is re- ceived, but the internal clock is not supplied to the cpu (remains at h ) until timer 1 underflows. the internal clock is supplied for the first time, when timer 1 underflows. this ensures time for the clock oscillation using the ceramic resonators to be stabilized. when the oscillator is restarted by reset, apply l level to the reset pin until the oscillation is stable since a wait time will not be generated. fig. 39 ceramic resonator circuit fig. 40 external clock input circuit (2) wait mode if the wit instruction is executed, the internal clock stops at an h level, but the oscillator does not stop. the internal clock re- starts at reset or when an interrupt is received. since the oscillator does not stop, normal operation can be started immediately after the clock is restarted. to ensure that the interrupts will be received to release the stp or wit state, their interrupt enable bits must be set to 1 before ex- ecuting of the stp or wit instruction. when releasing the stp state, the prescaler 12 and timer 1 will start counting the clock x in divided by 16. accordingly, set the timer 1 interrupt enable bit to 0 before executing the stp instruc- tion. note when using the oscillation stabilizing time set after stp instruction released bit set to 1 , evaluate time to stabilize oscillation of the used oscillator and set the value to the timer 1 and prescaler 12. x cin x cout x in x out c in c out c cin c cout rf rd x c i n x c o u t x i n x o u t c c i n c c o u t r f r d o p e n e x t e r n a l o s c i l l a t i o n c i r c u i t v c c v s s
36 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 41 structure of misrg [misrg (misrg)] 0038 16 misrg consists of three control bits (bits 1 to 3) for middle-speed mode automatic switch and one control bit (bit 0) for oscillation stabilizing time set after stp instruction released. by setting the middle-speed mode automatic switch start bit to 1 while operating in the low-speed mode and setting the middle- speed mode automatic switch set bit to 1 , x in oscillation automatically starts and the mode is automatically switched to the middle-speed mode. fig. 42 system clock generating circuit block diagram (single-chip mode) m i s r g ( m i s r g : a d d r e s s 0 0 3 8 1 6 ) o s c i l l a t i o n s t a b i l i z i n g t i m e s e t a f t e r s t p i n s t r u c t i o n r e l e a s e d b i t 0 : a u t o m a t i c a l l y s e t 0 1 1 6 t o t i m e r 1 , f f 1 6 t o p r e s c a l e r 1 2 1 : a u t o m a t i c a l l y s e t n o t h i n g b 7 b 0 n o t e :w h e n t h e m o d e i s a u t o m a t i c a l l y s w i t c h e d f r o m t h e l o w - s p e e d m o d e t o t h e m i d d l e - s p e e d m o d e , t h e v a l u e o f c p u m o d e r e g i s t e r ( a d d r e s s 0 0 3 b 1 6 ) c h a n g e s . not used (return 0 when read) middle-speed mode automatic switch start bit (depending on program) 0: invalid 1: automatic switch start middle-speed mode automatic switch wait time set bit 0: 4.5 to 5.5 machine cycles 1: 6.5 to 7.5 machine cycles middle-speed mode automatic switch set bit 0: not set automatically 1: automatic switching enable wit instruction stp instruction timing (internal clock) s r q s t p i n s t r u c t i o n s r q m a i n c l o c k s t o p b i t s r q 1 / 2 1/4 x in x o u t x cout x c i n i n t e r r u p t r e q u e s t r e s e t i n t e r r u p t d i s a b l e f l a g l 1/2 port x c switch bit 1 0 l o w - s p e e d m o d e high-speed or middle-speed mode middle-speed mode high-speed or low-speed mode main clock division ratio selection bits (note 1) n o t e s 1 : a n y o n e o f h i g h - s p e e d , m i d d l e - s p e e d o r l o w - s p e e d m o d e i s s e l e c t e d b y b i t s 7 a n d 6 o f t h e c p u m o d e r e g i s t e r . w h e n l o w - s p e e d m o d e i s s e l e c t e d , s e t p o r t x c s w i t c h b i t ( b 4 ) t o 1 . 2 : w h e n b i t 0 o f m i s r g = 0 m a i n c l o c k d i v i s i o n r a t i o s e l e c t i o n b i t s ( n o t e 1 ) ff 16 01 16 prescaler 12 t i m e r 1 reset or stp instruction (note 2)
37 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 43 state transitions of system clock cm 4 : port xc switch bit 0 : i/o port function (stop oscillating) 1 : x cin -x cout oscillating function cm 5 : main clock (x in - x out ) stop bit 0 : operating 1 : stopped cm 7 , cm 6 : main clock division ratio selection bit b7 b6 0 0 : = f(x in )/2 ( high-speed mode) 0 1 : = f(x in )/8 (middle-speed mode) 1 0 : = f(x cin )/2 (low-speed mode) 1 1 : not available n o t e s r e s e t c m 4 1 0 c m 4 0 1 c m 6 1 0 c m 4 1 0 c m 6 1 0 c m 7 1 0 c m 4 1 0 c m 5 1 0 cm 6 1 0 c m 6 1 0 cpu mode register b 7b 4 c m 7 0 1 c m 6 1 0 (cpum : address 003b 16 ) c m 7 = 0 c m 6 = 1 c m 5 = 0 ( 8 m h z o s c i l l a t i n g ) c m 4 = 0 ( 3 2 k h z s t o p p e d ) m i d d l e - s p e e d m o d e ( f ( ) = 1 m h z ) c m 7 = 0 c m 6 = 1 c m 5 = 0 ( 8 m h z o s c i l l a t i n g ) c m 4 = 1 ( 3 2 k h z o s c i l l a t i n g ) m i d d l e - s p e e d m o d e ( f ( ) = 1 m h z ) cm 7 = 0 cm 6 = 0 cm 5 = 0 (8 mhz oscillating) cm 4 = 0 (32 khz stopped) h i g h - s p e e d m o d e ( f ( ) = 4 m h z ) cm 7 = 1 cm 6 = 0 cm 5 = 0 (8 mhz oscillating) cm 4 = 1 (32 khz oscillating) low-speed mode (f( )=16 khz) c m 7 = 1 c m 6 = 0 c m 5 = 1 ( 8 m h z s t o p p e d ) c m 4 = 1 ( 3 2 k h z o s c i l l a t i n g ) l o w - s p e e d m o d e ( f ( ) = 1 6 k h z ) cm 7 = 0 cm 6 = 0 cm 5 = 0 (8 mhz oscillating) cm 4 = 1 (32 khz oscillating) high-speed mode (f( ) = 4 mhz) 1 : switch the mode by the allows shown between the mode blocks. (do not switch between the modes directly without an allow.) 2 : the all modes can be switched to the stop mode or the wait mode and return to the source mode when the stop mode or the wait mo de is ended. 3 : timer operates in the wait mode. 4 : when bit 0 of misrg is 0 and the stop mode is ended, a delay of approximately 1 ms occurs by connecting timer 1 in middle/high-speed mode. 5 : when bit 0 of misrg is 0 and the stop mode is ended, the following is performed. (1) after the clock is restarted, a delay of approximately 256 ms occurs in low-speed mode if timer 12 count source selection b it is 0 . (2) after the clock is restarted, a delay of approximately 16 ms occurs in low-speed mode if timer 12 count source selection bi t is 1 . 6 : wait until oscillation stabilizes after oscillating the main clock x in before the switching from the low-speed mode to middle/high-speed mode. 7 : the example assumes that 8 mhz is being applied to the x in pin and 32 khz to the x cin pin. indicates the internal clock.
38 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers flash memory version summary table 9 shows the summary of the m38507f8 (flash memory version). table 9 summary of m38507f8 (flash memory version) p o w e r s o u r c e v o l t a g e v c c = 2 . 7 5 . 5 v ( n o t e 1 ) v c c = 2 . 7 3 . 6 v ( n o t e 2 ) p r o g r a m / e r a s e v p p v o l t a g e 4 . 5 5 . 5 v , f ( x i n ) = 8 m h z f l a s h m e m o r y m o d e3 m o d e s ( p a r a l l e l i / o m o d e , s t a n d a r d s e r i a l i / o m o d e , c p u r e w r i t e m o d e ) e r a s e b l o c k d i v i s i o n u s e r r o m a r e a b o o t r o m a r e a 1 b l o c k ( 3 2 k b y t e s ) 1 b l o c k ( 4 k b y t e s ) ( n o t e 3 ) p r o g r a m m e t h o db y t e p r o g r a m erase method batch erasing p r o g r a m / e r a s e c o n t r o l m e t h o dp r o g r a m / e r a s e c o n t r o l b y s o f t w a r e c o m m a n d nu m b e r o f c o m m a n d s6 c o m m a n d s nu m b e r o f p r o g r a m / e r a s e t i m e s1 0 0 t i m e s r o m c o d e p r o t e c t i o na v a i l a b l e i n p a r a l l e l i / o m o d e , a n d s t a n d a r d s e r i a l i / o m o d e notes 1: the power source voltage must be vcc = 4.5 5.5 v at program and erase operation. 2: the power source voltage can be vcc = 3.0 3.6 v also at program and erase operation. 3: the boot rom area has had a standard serial i/o mode control program stored in it when shipped from the factory. this boot rom area can be rewritten in only parallel i/o mode. s p e c i f i c a t i o n i t e m
39 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers flash memory mode the m38507f8 (flash memory version) has an internal new dinor (divided bit line nor) flash memory that can be rewritten with a single power source when v cc is 5 v, and 2 power sources when v cc is 3.3 v. for this flash memory , three flash memory modes are available in which to read, program, and erase: parallel i/o and standard serial i/ o modes in which the flash memory can be manipulated using a programmer and a cpu rewrite mode in which the flash memory can be manipulated by the central processing unit (cpu). each mode is detailed in the pages to follow. fig. 44 block diagram of flash memory version the flash memory of the m38507f8 is divided into user rom area and boot rom area as shown in figure 44. in addition to the ordinary user rom area to store a microcomputer operation control program, the flash memory has a boot rom area that is used to store a program to control rewriting in cpu rewrite and standard serial i/o modes. this boot rom area has had a stan- dard serial i/o mode control program stored in it when shipped from the factory. however, the user can write a rewrite control program in this area that suits the user s application system. this boot rom area can be rewritten in only parallel i/o mode. 8 0 0 0 1 6 b l o c k 1 : 3 2 k b y t e user rom area 4 kbyte f 0 0 0 1 6 f f f f 1 6 f f f f 1 6 b o o t r o m a r e a notes 1: the boot rom area can be rewritten in only parallel input/output mode. (access to any other areas is inhibited.) 2: to specify a block, use the maximum address in the block. p r o d u c t n a m e f l a s h m e m o r y s t a r t a d d r e s s m38507f8 8000 16 p a r a l l e l i / o m o d e 8000 16 block 1 : 32 kbyte ffff 16 c p u r e w r i t e m o d e , s t a n d a r d s e r i a l i / o m o d e user rom area 4 kbyte f 0 0 0 1 6 f f f f 1 6 boot rom area bsel = 0 b s e l = 1 u s e r a r e a / b o o t a r e a s e l e c t i o n b i t = 0u s e r a r e a / b o o t a r e a s e l e c t i o n b i t = 1
40 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers cpu rewrite mode in cpu rewrite mode, the on-chip flash memory can be operated on (read, program, or erase) under control of the central processing unit (cpu). in cpu rewrite mode, only the user rom area shown in figure 44 can be rewritten; the boot rom area cannot be rewritten. make sure the program and block erase commands are issued for only the user rom area and each block area. the control program for cpu rewrite mode can be stored in either user rom or boot rom area. in the cpu rewrite mode, because the flash memory cannot be read from the cpu, the rewrite control pro- gram must be transferred to internal ram area before it can be ex- ecuted. microcomputer mode and boot mode the control program for cpu rewrite mode must be written into the user rom or boot rom area in parallel i/o mode beforehand. (if the control program is written into the boot rom area, the standard se- rial i/o mode becomes unusable.) see figure 44 for details about the boot rom area. normal microcomputer mode is entered when the microcomputer is reset with pulling cnv ss pin low. in this case, the cpu starts operat- ing using the control program in the user rom area. when the microcomputer is reset by pulling the p4 1 /int 0 pin high, the cnv ss pin high, the cpu starts operating using the control pro- gram in the boot rom area (program start address is fffc 16 , fffd 16 fixation). this mode is called the boot mode. block address block addresses refer to the maximum address of each block. these addresses are used in the block erase command. in case of the m38507f8, it has only one block. outline performance (cpu rewrite mode) in the cpu rewrite mode, the cpu erases, programs and reads the internal flash memory as instructed by software commands. this re- write control program must be transferred to internal ram before it can be executed. the cpu rewrite mode is accessed by applying 5v 10% to the cnv ss pin and writing 1 for the cpu rewrite mode select bit (bit 1 in address 0ffe 16 ). software commands are accepted once the mode is accessed. use software commands to control program and erase operations. whether a program or erase operation has terminated normally or in error can be verified by reading the status register. figure 45 shows the flash memory control register. _____ bit 0 is the ry/by status flag used exclusively to read the operating status of the flash memory. during programming and erase opera- tions, it is 0 . otherwise, it is 1 . bit 1 is the cpu rewrite mode select bit. when this bit is set to 1 and 5v 10% are applied to the cnv ss pin, the m38507f8 accesses the cpu rewrite mode. software commands are accepted once the mode is accessed. in cpu rewrite mode, the cpu becomes unable to access the internal flash memory directly. therefore, use the con- trol program in ram for write to bit 1. to set this bit to 1 , it is neces- sary to write 0 and then write 1 in succession. the bit can be set to 0 by only writing a 0 . bit 2 is the cpu rewrite mode entry flag. this bit can be read to check whether the cpu rewrite mode has been entered or not. bit 3 is the flash memory reset bit used to reset the control circuit of the internal flash memory. this bit is used when exiting cpu rewrite mode and when flash memory access has failed. when the cpu rewrite mode select bit is 1 , writing 1 for this bit resets the control circuit. to release the reset, it is necessary to set this bit to 0 . bit 4 is the user area/boot area selection bit. when this bit is set to 1 , boot rom area is accessed, and cpu rewrite mode in boot rom area is available. in boot mode, this bit is set 1 automatically. operation of this bit must be in ram area. figure 46 shows a flowchart for setting/releasing the cpu rewrite mode. precautions on cpu rewrite mode described below are the precautions to be observed when rewriting the flash memory in cpu rewrite mode. (1) operation speed during cpu rewrite mode, set the internal clock frequency 4mhz or less using the main clock division ratio selection bits (bit 6, 7 at 003b 16 ). (2) instructions inhibited against use the instructions which refer to the internal data of the flash memory cannot be used during cpu rewrite mode . (3) interrupts inhibited against use the interrupts cannot be used during cpu rewrite mode be- cause they refer to the internal data of the flash memory. (4) watchdog timer in case of the watchdog timer has been running already, the in- ternal reset generated by watchdog timer underflow does not happen, because of watchdog timer is always clearing during program or erase operation. (5) reset reset is always valid. in case of cnv ss = h when reset is re- leased, boot mode is active. so the program starts from the ad- dress contained in address fffc 16 and fffd 16 in boot rom area.
41 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 45 flash memory control registers fig. 46 cpu rewrite mode set/reset flowchart f l a s h m e m o r y c o n t r o l r e g i s t e r s y m b o la d d r e s sw h e n r e s e t f m c r0 f f e 1 6 x x x 0 0 0 0 1 w r b 7 b 5 b 4 b 2 b 1 b 0 f m c r 0 b i t s y m b o l b i t n a m e function r w 0: busy (being written or erased) 1: ready c p u r e w r i t e m o d e s e l e c t b i t ( n o t e 1 ) 0: normal mode (software commands invalid) 1: cpu rewrite mode (software commands acceptable) f m c r 1 c p u r e w r i t e m o d e e n t r y f l a g f l a s h m e m o r y r e s e t b i t ( n o t e 2 ) 0: normal operation 1: reset f m c r 2 f m c r 3 notes 1: for this bit to be set to 1 , the user needs to write a 0 and then a 1 to it in succession. 2: effective only when the cpu rewrite mode select bit = 1. set this bit to 0 subsequently after setting it to 1 (reset). r y / b y s t a t u s f l a g 0: normal mode (software commands invalid) 1: cpu rewrite mode (software commands acceptable) nothing is assigned. when write, set 0 . when read, values are indeterminate. u s e r a r e a / b o o t a r e a s e l e c t i o n b i t 0: user rom area 1: boot rom area f m c r 4 b 3 b 6 e n d s t a r t e x e c u t e r e a d a r r a y c o m m a n d o r r e s e t f l a s h m e m o r y b y s e t t i n g f l a s h m e m o r y r e s e t b i t ( b y w r i t i n g 1 a n d t h e n 0 i n s u c c e s s i o n ) ( n o t e 2 ) s i n g l e - c h i p m o d e , o r b o o t m o d e s e t c p u m o d e r e g i s t e r ( n o t e 1 ) u s i n g s o f t w a r e c o m m a n d e x e c u t e e r a s e , p r o g r a m , o r o t h e r o p e r a t i o n j u m p t o t r a n s f e r r e d c o n t r o l p r o g r a m i n r a m ( s u b s e q u e n t o p e r a t i o n s a r e e x e c u t e d b y c o n t r o l p r o g r a m i n t h i s r a m ) transfer cpu rewrite mode control program to internal ram notes 1: set bit 6, 7 (main clock division ratio selection bits ) at cpu mode register (003b 16 ). 2: before exiting the cpu rewrite mode after completing erase or program operation, always be sure to execute a read array command or reset the flash memory. w r i t e 0 t o c p u r e w r i t e m o d e s e l e c t b i t s e t c p u r e w r i t e m o d e s e l e c t b i t t o 1 ( b y w r i t i n g 0 a n d t h e n 1 i n s u c c e s s i o n ) c h e c k t h e c p u r e w r i t e m o d e e n t r y f l a g * 1 * 1 p r o g r a m i n r o m program in ram
42 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers software commands table 10 lists the software commands. after setting the cpu rewrite mode select bit to 1 , write a software command to specify an erase or program operation. the content of each software command is explained below. read array command (ff 16 ) the read array mode is entered by writing the command code ff 16 in the first bus cycle. when an address to be read is input in one of the bus cycles that follow, the content of the specified address is read out at the data bus (d 0 d 7 ). the read array mode is retained intact until another command is writ- ten. and after power on and after recover from deep power down mode, this mode is selected also. table 10 list of software commands (cpu rewrite mode) read status register command (70 16 ) when the command code 70 16 is written in the first bus cycle, the content of the status register is read out at the data bus (d 0 d 7 ) by a read in the second bus cycle. the status register is explained in the next section. clear status register command (50 16 ) this command is used to clear the bits sr1,sr4 and sr5 of the status register after they have been set. these bits indicate that op- eration has ended in an error. to use this command, write the com- mand code 50 16 in the first bus cycle. c o m m a n d program c l e a r s t a t u s r e g i s t e r read array r e a d s t a t u s r e g i s t e r x x x x first bus cycle second bus cycle ff 1 6 7 0 1 6 5 0 1 6 40 16 write write write write xsrd read write erase all bloc k x 20 16 write x 20 16 write (note 1) wa (note 2) wd (note 2) b l o c k e r a s e x2 0 1 6 write d0 16 w r i t e b a (note 3) mode a d d r e s s m o d e a d d r e s s d a t a (d 0 to d 7 ) data ( d 0 t o d 7 ) (note 4) notes 1: srd = status register data 2: wa = write address, wd = write data 3: ba = block address (enter the maximum address of each block.) 4: x denotes a given address in the user rom area . c y c l e n u m b e r 1 2 1 2 2 2
43 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 47 program flowchart program command (40 16 ) program operation starts when the command code 40 16 is written in the first bus cycle. then, if the address and data to program are written in the 2nd bus cycle, program operation (data programming and verification) will start. whether the write operation is completed can be confirmed by read- _____ ing the status register or the ry/by status flag. when the program starts, the read status register mode is accessed automatically and the content of the status register is read into the data bus (d0 d7). the status register bit 7 (sr7) is set to 0 at the same time the write operation starts and is returned to 1 upon completion of the write operation. in this case, the read status register mode remains active until the read array command (ff 16 ) is written. ____ the ry/by status flag is 0 during write operation and 1 when the write operation is completed as is the status register bit 7. at program end, program results can be checked by reading the sta- tus register. erase all blocks command (20 16 /20 16 ) by writing the command code 20 16 in the first bus cycle and the confirmation command code 20 16 in the second bus cycle that fol- lows, the system starts erase all blocks( erase and erase verify). whether the erase all blocks command is terminated can be con- ____ firmed by reading the status register or the ry/by status flag. when the erase all blocks operation starts, the read status register mode is accessed automatically and the content of the status register can be read out. the status register bit 7 (sr7) is set to 0 at the same time the erase operation starts and is returned to 1 upon completion of the erase operation. in this case, the read status register mode re- mains active until the read array command (ff 16 ) is written. ____ the ry/by status flag is 0 during erase operation and 1 when the erase operation is completed as is the status register bit 7. at erase all blocks end, erase results can be checked by reading the status register. for details, refer to the section where the status reg- ister is detailed. block erase command (20 16 /d0 16 ) by writing the command code 20 16 in the first bus cycle and the confirmation command code d0 16 in the second bus cycle that follows to the block address of a flash memory block, the system initiates a block erase (erase and erase verify) operation. whether the block erase operation is completed can be confirmed ____ by reading the status register or the ry/by status flag. at the same time the block erase operation starts, the read status register mode is automatically entered, so the content of the status register can be read out. the status register bit 7 (sr7) is set to 0 at the same time the block erase operation starts and is returned to 1 upon comple- tion of the block erase operation. in this case, the read status regis- ter mode remains active until the read array command (ff 16 ) is writ- ten. ____ the ry/by status flag is 0 during block erase operation and 1 when the block erase operation is completed as is the status register bit 7. after the block erase operation is completed, the status register can be read out to know the result of the block erase operation. for de- tails, refer to the section where the status register is detailed. fig. 48 erase flowchart start write 40 16 status register read program completed no yes write address write data sr4=0? program error no yes sr7=1? or ry/by=1? write write 20 16 20 16 /d0 16 block address erase completed no yes start write sr5=0? erase error yes no 20 16 :erase all blocks d0 16 :block erase sr7=1? or ry/by=1? status register read
44 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers table 11 definition of each bit in status register status register the status register shows the operating state of the flash memory and whether erase operations and programs ended successfully or in error. it can be read in the following ways. (1) by reading an arbitrary address from the user rom area after writing the read status register command (70 16 ) (2) by reading an arbitrary address from the user rom area in the period from when the program starts or erase operation starts to when the read array command (ff 16 ) is input table 11 shows the status register. also, the status register can be cleared in the following way. (1) by writing the clear status register command (50 16 ) (2) in the deep power down mode (3) in the power supply off state after a reset, the status register is set to 80 16 . each bit in this register is explained below. sequencer status (sr7) after power-on, and after recover from deep power down mode, the sequencer status is set to 1 (ready). the sequencer status indicates the operating status of the device. this status bit is set to 0 (busy) during write or erase operation and is set to 1 upon completion of these operations. erase status (sr5) the erase status informs the operating status of erase operation to the cpu. when an erase error occurs, it is set to 1 . the erase status is reset to 0 when cleared. program status (sr4) the program status informs the operating status of write operation to the cpu. when a write error occurs, it is set to 1 . the program status is reset to 0 when cleared. if 1 is written for any of the sr5 or sr4 bits, the program, erase all blocks, and block erase commands are not accepted. before ex- ecuting these commands, execute the clear status register com- mand (50 16 ) and clear the status register. also, any commands are not correct, both sr5 and sr4 are set to 1 . each bit of srd0 bits sr7 (bit7) sr6 (bit6) sr5 (bit5) sr4 (bit4) sr3 (bit3) sr2 (bit2) sr1 (bit1) sr0 (bit0) definition 1 0 sequencer status reserved erase status program status reserved reserved reserved reserved ready - terminated in error terminated in error - - - - status name busy - terminated normally terminated normally - - - -
45 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers full status check by performing full status check, it is possible to know the execution results of erase and program operations. figure 49 shows a full sta- fig. 49 full status check flowchart and remedial procedure for errors tus check flowchart and the action to be taken when each error oc- curs. read status register sr4=1 and sr5 =1 ? no yes sr5=0? yes block erase error no sr4=0? yes no command sequence error program error end (block erase, program) execute the clear status register command (50 16 ) to clear the status register. try performing the operation one more time after confirming that the command is entered correctly. should a block erase error occur, the block in error cannot be used. note: when one of sr5 to sr4 is set to 1 , none of the program, erase all blocks, and block erase commands is accepted. execute the clear status register command (50 16 ) before executing these commands. should a program error occur, the block in error cannot be used.
46 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers functions to inhibit rewriting flash memory version to prevent the contents of the flash memory version from being read out or rewritten easily, the device incorporates a rom code protect function for use in parallel i/o mode and an id code check function for use in standard serial i/o mode. rom code protect function the rom code protect function is the function inhibit reading out or modifying the contents of the flash memory version by using the rom code protect control address (ffdb 16 ) during parallel i/o mode. figure 50 shows the rom code protect control address (ffdb 16 ). (this address exists in the user rom area.) if one of the pair of rom code protect bits is set to 0 , rom code protect is turned on, so that the contents of the flash memory ver- sion are protected against readout and modification. rom code protect is implemented in two levels. if level 2 is selected, the flash memory is protected even against readout by a shipment inspection lsi tester, etc. when an attempt is made to select both level 1 and level 2, level 2 is selected by default. if both of the two rom code protect reset bits are set to 00 , rom code protect is turned off, so that the contents of the flash memory version can be read out or modified. once rom code protect is turned on, the contents of the rom code protect reset bits cannot be modified in parallel i/o mode. use the serial i/o or some other mode to rewrite the contents of the rom code protect reset bits. fig. 50 rom code protect control address s y m b o la d d r e s sw h e n r e s e t r o m c pf f d b 1 6 f f 1 6 r o m c o d e p r o t e c t l e v e l 2 s e t b i t ( n o t e 1 , 2 ) 00: protect enabled 01: protect enabled 10: protect enabled 11: protect disabled r o m c o d e p r o t e c t c o n t r o l a d d r e s s b i t n a m e function b i t s y m b o l b7 b6 b 5b 4b 3b 2b 1b 0 00: protect removed 01: protect set bit effective 10: protect set bit effective 11: protect set bit effective 00: protect enabled 01: protect enabled 10: protect enabled 11: protect disabled r o m c o d e p r o t e c t r e s e t b i t ( n o t e 3 ) r o m c o d e p r o t e c t l e v e l 1 s e t b i t ( n o t e 1 ) r o m c p 2 r o m c r romcp1 b3 b2 b5 b4 b7 b6 n o t e s 1 : w h e n r o m c o d e p r o t e c t i s t u r n e d o n , t h e o n - c h i p f l a s h m e m o r y i s p r o t e c t e d a g a i n s t r e a d o u t o r m o d i f i c a t i o n i n p a r a l l e l i n p u t / o u t p u t m o d e . 2 : w h e n r o m c o d e p r o t e c t l e v e l 2 i s t u r n e d o n , r o m c o d e r e a d o u t b y a s h i p m e n t i n s p e c t i o n l s i t e s t e r , e t c . a l s o i s i n h i b i t e d . 3 : t h e r o m c o d e p r o t e c t r e s e t b i t s c a n b e u s e d t o t u r n o f f r o m c o d e p r o t e c t l e v e l 1 a n d r o m c o d e p r o t e c t l e v e l 2 . h o w e v e r , s i n c e t h e s e b i t s c a n n o t b e c h a n g e d i n p a r a l l e l i n p u t / o u t p u t m o d e , t h e y n e e d t o b e r e w r i t t e n i n s e r i a l i n p u t / o u t p u t m o d e o r s o m e o t h e r m o d e . reserved bit a l w a y s s e t t h i s b i t t o 1 11
47 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers id code check function use this function in standard serial i/o mode. when the contents of the flash memory are not blank, the id code sent from the peripheral unit is compared with the id code written in the flash memory to see if they match. if the id codes do not match, the commands sent from the peripheral unit are not accepted. the id code consists of 8-bit data, the areas of which are ffd4 16 to ffda 16 . write a program which has had the id code preset at these addresses to the flash memory. fig. 51 id code store addresses rom cord protect control id7 id6 id5 id4 id3 id2 id1 ffdb 16 ffda 16 ffd9 16 ffd8 16 ffd7 16 ffd6 16 ffd5 16 ffd4 16 address interrupt vector area
48 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers bus operation modes read _____ _____ the read mode is entered by pulling the oe pin low when the ce _____ _____ pin is low and the we and rp pins are high. there are two read modes: array, and status register, which are selected by software command input. in read mode, the data corresponding to each soft- ware command entered is output from the data i/o pins d 0 d 7 . the read array mode is automatically selected when the device is pow- ered on or after it exits deep power down mode. output disable _____ the output disable mode is entered by pulling the ce pin low and the _____ _____ _____ we, oe, and rp pins high. also, the data i/o pins are placed in the high-impedance state. standby _____ _____ the standby mode is entered by driving the ce pin high when the rp pin is high. also, the data i/o pins are placed in the high-impedance _____ state. however, if the ce pin is set high during erase or program operation, the internal control circuit does not halt immediately and normal power consumption is required until the operation under way is completed. write _____ _____ the write mode is entered by pulling the we pin low when the ce pin _____ _____ is low and the oe and rp pins are high. in this mode, the device accepts the software commands or write data entered from the data i/o pins. a program, erase, or some other operation is initiated de- pending on the content of the software command entered here. the input data such as address and software command is latched at the _____ _____ rising edge of we or ce whichever occurs earlier. deep power down _____ the deep power down is entered by pulling the rp pin low. also, the data i/o pins are placed in the high-impedance state. when the de- vice is freed from deep power down mode, the read array mode is selected and the content of the status register is set to 80 16 . if the _____ rp pin is pulled low during erase or program operation, the opera- tion under way is canceled and the data in the relevant block be- comes invalid. user rom and boot rom areas in parallel i/o mode, the user rom and boot rom areas shown in fig- ure 44 can be rewritten. the bsel pin is used to choose between these two areas. the user rom area is selected by pulling the bsel input low; the boot rom area is selected by driving the bsel input high. both areas of flash memory can be operated on in the same way. program and block erase operations can be performed in the user rom area. the user rom area and its block is shown in figure 44. the user rom area is 32 kbytes in size. in parallel i/o mode, it is located at addresses 8000 16 through ffff 16 . the boot rom area is 4 kbytes in size. in parallel i/o mode, it is located at addresses f000 16 through ffff 16 . make sure program and block erase opera- tions are always performed within this address range. (access to any location outside this address range is prohibited.) in the boot rom area, an erase block operation is applied to only one 4 kbyte block. the boot rom area has had a standard serial i/o mode control program stored in it when shipped from the mitsubishi factory. therefore, using the device in standard serial input/output mode, you do not need to write to the boot rom area. functional outline (parallel i/o mode) in parallel i/o mode, bus operation modes read, output disable, standby, write, and deep power down are selected by the status _____ _____ _____ _____ of the ce, oe, we, and rp input pins. the contents of erase, program, and other operations are selected by writing a software command. the data, status register, etc. in memory can only be read out by a read after software command input. program and erase operations are controlled using software com- mands. the following explains about bus operation modes, software com- mands, and status register. d 0 to d 7 data output status register data output high impedance high impedance command/data input command input command input high impedance _____ rp v ih v ih v ih v ih v ih v ih v ih v il ______ we v ih v ih v ih x v il v il v il x _____ oe v il v il v ih x v ih v ih v ih x _____ ce v il v il v il v ih v il v il v il x pin name mode array status register output disabled stand by program write erase other deep power down read note : x can be v il or v ih . table 12 relationship between control signals and bus operation modes parallel i/o mode the parallel i/o mode is entered by making connections shown in figure 52 and then turning the vcc power supply on. address the user rom is only one block as shown in figure 44. the block address referred to in this data sheet is the maximum address value of each block.
49 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers table 13 description of pin function (flash memory parallel i/o mode) p i n n a m es i g n a l n a m e i/ o function v c c , v s s p o w e r s u p p l y i n p u ta p p l y 5 . 0 0 . 5 v t o t h e v c c p i n a n d 0 v t o t h e v s s p i n . c n v s s c n v s s c o n n e c t t h i s p i n t o v c c . i r e s e t i n p u t r e s e t i n p u t p i n . w h e n r e s e t i s h e l d l o w , m o r e t h a n 2 0 c y c l e s o f c l o c k a r e r e q u i r e d a t t h e x i n p i n . i r e s e t i x i n c l o c k i n p u t c o n n e c t a c e r a m i c o r c r y s t a l r e s o n a t o r b e t w e e n t h e x i n a n d x o u t p i n s . w h e n e n t e r i n g a n e x t e r n a l l y d r i v e d c l o c k , e n t e r i t f r o m x i n a n d l e a v e x o u t o p e n . i x o u t c l o c k o u t p u to a v s s a n a l o g p o w e r s u p p l y i n p u t v r e f r e f e r e n c e v o l t a g e i n p u t i c o n n e c t a v s s t o v s s . i n p u t a d r e f e r e n c e v o l t a g e o r k e e p o p e n . p 0 0 t o p 0 7 a d d r e s s i n p u t a 0 t o a 7 these are address a 0 a 7 input pins. i p1 0 to p1 7 i these are address a 8 a 15 input pins. d a t a i / o d 0 t o d 7 t h e s e a r e d a t a d 0 d 7 i n p u t / o u t p u t p i n s . i / o p2 0 to p2 7 i p 3 0 b s e l i n p u tt h i s i s a b s e l i n p u t p i n . address input a 8 to a 15 p 3 3 i p3 4 i rp input this is a rp input pin. w e i n p u t t h i s i s a w e i n p u t p i n . i p4 2 to p4 4 i p4 1 input p4 1 ce input oe input t h i s i s a o e i n p u t p i n . this is a ce input pin. p4 0 o ry/by output t h i s i s a r y / b y o u t p u t p i n . input p4 i i p 3 1 i p 3 2 input h or l or keep open. enter low signals to this pin.
50 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 52 pin connection diagram in parallel i/o mode p4 0 /cntr 1 p4 1 /int 0 p4 2 /int 1 p4 3 /int 2 /s cmp2 av ss p4 4 /int 3 /pwm v ref p3 1 /an 1 p3 2 /an 2 p0 0 /s in2 p0 4 p0 5 p0 6 p0 7 p1 1 /(led 1 ) p1 2 /(led 2 ) p1 3 /(led 3 ) p1 4 /(led 4 ) p1 5 /(led 5 ) p1 0 /(led 0 ) p0 1 /s out2 p0 2 /s clk2 p3 0 /an 0 p3 3 /an 3 p3 4 /an 4 40 41 42 22 23 24 25 26 27 28 29 30 31 32 34 35 36 37 38 39 33 3 2 1 21 20 19 18 17 16 15 14 13 12 11 9 8 7 6 5 4 10 m38507f8sp/fp p1 6 /(led 6 ) p1 7 /(led 7 ) p2 7 /cntr 0 /s rdy1 p2 6 /s clk1 p2 5 /scl 2 /txd p2 4 /sda 2 /rxd cnv ss p2 1 /x cin p2 0 /x cout reset x in x out v ss p0 3 /s rdy2 d 1 d 0 a 15 a 14 a 13 a 12 a 11 a 10 a 9 a 8 d 7 d 6 d 5 d 4 d 3 d 2 ce oe rp we bsel ry/by a 7 a 6 a 5 a 4 a 3 a 2 a 1 a 0 p2 3 /scl 1 p2 2 /sda 1 v cc v ss v cc signal value cnv ss v cc p4 1 /int 0 v ss v ss reset ? connect oscillator circuit mode setup method ?
51 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers software commands table 14 lists the software commands. by entering a software com- mand from the data i/o pins (d 0 d 7 ) in write mode, specify the con- tent of the operation, such as erase or program operation, to be per- formed. the following explains the content of each software command. read array command (ff 16 ) the read array mode is entered by writing the command code ff 16 in the first bus cycle. when an address to be read is input in one of the bus cycles that follow, the content of the specified address is output from the data i/o pins (d 0 d 7 ). the read array mode is retained intact until another command is writ- ten. the read array mode is also selected automatically when the device is powered on and after it exits deep power down mode. command read array read status register clear status register program all block erase block erase mode write write write write write write address x (note 4) x x x x x data (d 0 to d 7 ) ff 16 70 16 50 16 40 16 20 16 20 16 mode read write write write address x wa (note 2) x ba (note 3) data (d 0 to d 7 ) srd (note 1) wd (note 2) 20 16 d0 16 first bus cycle second bus cycle notes 1: srd = status register data 2: wa = write address, wd = write data 3: ba = block address (enter the maximum address of each block) 4: x denotes a given address in the user rom area or boot rom area. read status register command (70 16 ) when the command code 70 16 is written in the first bus cycle, the content of the status register is output from the data i/o pins (d 0 d 7 ) by a read in the second bus cycle. since the content of the status _____ _____ _____ _____ register is updated at the falling edge of oe or ce, the oe or ce signal must be asserted each time the status is read. the status register is explained in the next section. clear status register command (50 16 ) this command is used to clear the bits sr4,sr5 of the status regis- ter after they have been set. these bits indicate that operation has ended in an error. to use this command, write the command code 50 16 in the first bus cycle. table 14 software command list (parallel i/o mode) cycle number 1 2 1 2 2 2
52 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 54 block erase flowchart program command (40 16 ) the program operation starts when the command code 40 16 is writ- ten in the first bus cycle. then, if the address and data to program are written in the 2nd bus cycle, program operation (data program- ming and verification) will start. whether the write operation is completed can be confirmed by read- _____ ing the status register or the ry/by signal status. when the program starts, the read status register mode is accessed automatically and the content of the status register can be read out from the data bus (d 0 d 7 ). the status register bit 7 (sr7) is set to 0 at the same time the write operation starts and is returned to 1 upon completion of the write operation. in this case, the read status register mode re- mains active until the read array command (ff 16 ) is written. ____ the ry/by pin is l during write operation and h when the write operation is completed as is the status register bit 7. at program end, program results can be checked by reading the sta- tus register. erase all blocks command (20 16 /20 16 ) by writing the command code 20 16 in the first bus cycle and the confirmation command code 20 16 in the second bus cycle that fol- lows, the system starts erase all blocks( erase and erase verify). whether the erase all blocks command is terminated can be con- ____ firmed by reading the status register or the ry/by signal status . when the erase all blocks operation starts, the read status register mode is accessed automatically and the content of the status regis- ter can be read out. the status register bit 7 (sr7) is set to 0 at the same time the erase operation starts and is returned to 1 upon completion of the erase operation. in this case, the read status regis- ter mode remains active until the read array command (ff 16 ) is writ- ten. ____ the ry/by pin is l during erase operation and h when the erase operation is completed as is the status register bit 7. at erase all blocks end, erase results can be checked by reading the status register. for details, refer to the section where the status reg- ister is detailed. block erase command (20 16 /d0 16 ) by writing the command code 20 16 in the first bus cycle and the confirmation command code d0 16 in the second bus cycle that follows to the block address of a flash memory block, the system initiates a block erase (erase and erase verify) operation. whether the block erase operation is completed can be confirmed ____ by reading the status register or the ry/by signal. at the same time the block erase operation starts, the read status register mode is automatically entered, so the content of the status register can be read out. the status register bit 7 (sr7) is set to 0 at the same time the block erase operation starts and is returned to 1 upon comple- tion of the block erase operation. in this case, the read status regis- ter mode remains active until the read array command (ff 16 ) is writ- ten. ____ the ry/by pin is l during block erase operation and h when the block erase operation is completed as is the status register bit 7. after the block erase operation is completed, the status register can be read out to know the result of the block erase operation. for de- tails, refer to the section where the status register is detailed. fig. 53 page program flowchart start write 40 16 status register read program completed no yes write address write data sr4=0? program error no yes sr7=1? or ry/by=1? write write 20 16 20 16 /d0 16 block address erase completed no yes start write sr5=0? erase error yes no 20 16 :erase all blocks d0 16 :block erase sr7=1? or ry/by=1? status register read
53 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers status register the status register indicates status such as whether an erase opera- tion or a program ended successfully or in error. it can be read under the following conditions. (1) in the read array mode when the read status register command (70 16 ) is written and the block address is subsequently read. (2) in the period from when the program write or auto erase starts to when the read array command (ff 16 ) the status register is cleared in the following situations. (1) by writing the clear status register command (50 16 ) (2) in the deep power down mode (3) in the power supply off state table 15 gives the definition of each status register bit. when power is turned on or returning from the deep power down mode, the status register outputs 80 16 . sequencer status (sr7) the sequencer status indicates the operating status of the flash memory. when power is turned on or returning from the deep power down mode, 1 is set for it. this bit is 0 (busy) during the write or erase operations and becomes 1 when these operations ends. erase status (sr5) the erase status reports the operating status of the erase operation. if an erase error occurs, it is set to 1 . when the erase status is cleared, it is set to 0 . program status (sr4) the program status reports the operating status of the write opera- tion. if a write error occurs, it is set to 1 . when the program status is cleared, it is set to 0 . if 1 is written for any of the sr5, sr4 bits, the program erase all blocks, block erase, commands are not accepted. before executing these commands, execute the clear status register command (50 16 ) and clear the status register. also, any commands are not correct, both sr5 and sr4 are set to 1 . full status check results from executed erase and program operations can be known by running a full status check. figure 55 shows a flowchart of the full status check and explains how to remedy errors which occur. ____ ready/busy (ry/by) pin ____ the ry/by pin is an output pin (n-chanel open drain output) which, like the sequencer status (sr7), indicates the operating status of the flash memory. it is l level during auto program or auto erase opera- tions and becomes to the high impedance state (ready state) when ____ these operations end. the ry/by pin requires an external pull-up. table 15 status register each bit of srd0 bits sr7 (d 7 ) sr6 (d 6 ) sr5 (d 5 ) sr4 (d 4 ) sr3 (d 3 ) sr2 (d 2 ) sr1 (d 1 ) sr0 (d 0 ) sequencer status reserved erase status program status reserved reserved reserved reserved 1 ready - ended in error ended in error - - - - status name 0 busy - ended successfully ended successfully - - - - definition
54 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 55 full status check flowchart and remedial procedure for errors read status register sr4=1 and sr5 =1 ? no yes sr5=0? yes block erase error no sr4=0? yes no command sequence error program error end (block erase, program) execute the clear status register command (50 16 ) to clear the status register. try performing the operation one more time after confirming that the command is entered correctly. should a block erase error occur, the block in error cannot be used. note: when one of sr5 to sr4 is set to 1 , none of the program, all blocks erase, or block erase is accepted. execute the clear status register command (50 16 ) before executing these commands. should a program error occur, the block in error cannot be used.
55 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers standard serial i/o mode the standard serial i/o mode inputs and outputs the software com- mands, addresses and data needed to operate (read, program, erase, etc.) the internal flash memory. this i/o is clock synchronized serial. this modes require a purpose-specific peripheral unit. the standard serial i/o mode is different from the parallel i/o mode in that the cpu controls flash memory rewrite (uses the cpu's re- write mode), rewrite data input and so forth. the standard serial i/o mode is started by connecting h to the p4 1 (int 0 ) pin and h to the cnv ss pin (when v cc = 4.5 v to 5.5 v, connect to v cc ; when v cc = 2.7 v to 4.5 v, supply 4.5 v to 5.5 v to vpp from an external source), and releasing the reset operation. (in the ordinary command mode, set cnvss pin to l level.) this control program is written in the boot rom area when the prod- uct is shipped from mitsubishi. accordingly, make note of the fact that the standard serial i/o mode cannot be used if the boot rom area is rewritten in the parallel i/o mode. figure 56 shows the pin connections for the standard serial i/o mode. serial data i/o uses si/ o1 data serially in 8-bit units. to use standard serial i/o mode. the operation uses the four si/o1 __________ pins s clk , rxd, txd and s rdy1 (busy). the s clk pin is the trans- fer clock input pin through which an external transfer clock is input. __________ the txd pin is for cmos output. the s rdy1 (busy) pin outputs an l level when ready for reception and an h level when reception starts. in the standard serial i/o mode, only the user rom area indicated in figure 44 can be rewritten. the boot rom cannot. in the standard serial i/o mode, a 7-byte id code is used. when there is data in the flash memory, commands sent from the periph- eral unit (programmer) are not accepted unless the id code matches. overview of standard serial i/o mode in standard serial i/o mode, software commands, addresses and data are input and output between the mcu and peripheral units (serial programer, etc.) using 4-wire clock-synchronized serial i/o (si/o1). in reception, software commands, addresses and program data are synchronized with the rise of the transfer clock that is input to the s clk pin, and are then input to the mcu via the rxd pin. in transmis- sion, the read data and status are synchronized with the fall of the transfer clock, and output from the txd pin. the txd pin is for cmos output. transfer is in 8-bit units with lsb first. when busy, such as during transmission, reception, erasing or pro- __________ gram execution, the s rdy1 (busy) pin is h level. accordingly, al- __________ ways start the next transfer after the s rdy1 (busy) pin is l level. also, data and status registers in memory can be read after inputting software commands. status, such as the operating state of the flash memory or whether a program or erase operation ended success- fully or not, can be checked by reading the status register. here fol- lowing are explained software commands, status registers, etc.
56 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers table 16 pin functions (flash memory standard serial i/o mode) pin description v cc ,v ss apply program/erase protection voltage to vcc pin and 0 v to vss pin. cnv ss connect to v cc when v cc = 4.5 v to 5.5 v. connect to vpp (=4.5 v to 5.5 v) when v cc = 2.7 v to 4.5 v. reset reset input pin. while reset is l level, a 20 cycle or longer clock must be input to x in pin. x in connect a ceramic resonator or crystal oscillator between x in and x out pins. to input an externally generated clock, input it to x in pin and open x out pin. x out name power input cnv ss reset input clock input clock output i/o i i i o av ss v ref connect av ss to v ss . enter the reference voltage for ad from this pin. p0 0 to p0 7 input h or l level signal or open. p1 0 to p1 7 input h or l level signal or open. p2 0 to p2 3 input h or l level signal or open. analog power supply input reference voltage input input port p0 input port p1 input port p2 i i i i p4 1 input h level signal, when reset is released. p4 0, p4 2 to p4 4 input h or l level signal or open. p2 4 serial data input pin p2 5 p2 6 serial clock input pin p2 7 busy signal output pin input p4 1 input port p4 rxd input txd output s clk input busy output i i o i o serial data output pin i p3 0 to p3 4 input h or l level signal or open. input port p3 i
57 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 56 connection for serial i/o mode p4 0 /cntr 1 p4 1 /int 0 p4 2 /int 1 p 4 3 / i n t 2 / s c m p 2 a v s s p 4 4 / i n t 3 / p w m v r e f p 3 1 / a n 1 p 3 2 / a n 2 p 0 0 / s i n 2 p 0 4 p 0 5 p 0 6 p 0 7 p 1 1 / ( l e d 1 ) p 1 2 / ( l e d 2 ) p 1 3 / ( l e d 3 ) p 1 4 / ( l e d 4 ) p 1 5 / ( l e d 5 ) p 1 0 / ( l e d 0 ) p 0 1 / s o u t 2 p 0 2 / s c l k 2 p 3 0 / a n 0 p 3 3 / a n 3 p 3 4 / a n 4 4 0 4 1 4 2 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 3 0 3 1 3 2 3 4 3 5 3 6 3 7 3 8 3 9 3 3 3 2 1 21 20 19 18 17 16 15 14 13 12 11 9 8 7 6 5 4 10 m 3 8 5 0 7 f 8 s p / f p p 1 6 / ( l e d 6 ) p 1 7 / ( l e d 7 ) p 2 7 / c n t r 0 / s r d y 1 p 2 6 / s c l k 1 p 2 5 / s c l 2 / t x d p 2 4 / s d a 2 / r x d c n v s s p 2 1 / x c i n p 2 0 / x c o u t reset x in x o u t v s s p 0 3 / s r d y 2 p 4 1 s c l k ? 1 p 2 3 / s c l 1 p 2 2 / s d a 1 v c c v s s v c c r e s e t v pp ? 2 r x d t x d r x d b u s y n o t e s 1 : c o n n e c t o s c i l l a t o r c i r c u i t 2 : c o n n e c t t o v c c w h e n v c c = 4 . 5 v t o 5 . 5 v . c o n n e c t t o v p p ( = 4 . 5 v t o 5 . 5 v ) w h e n v c c = 2 . 7 v t o 4 . 5 v . 3 : i t i s n e c e s s a r y t o a p p l y v c c o n l y w h e n r e s e t i s r e l e a s e d . s i g n a l value c n v s s p 4 1 r e s e t m o d e s e t u p m e t h o d 4 . 5 t o 5 . 5 v v c c ? 3 v s s v c c
58 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers software commands table 17 lists software commands. in the standard serial i/o mode, erase operations, programs and reading are controlled by transfer- ring software commands via the rxd pin. software commands are control command 2nd byte 3rd byte 4th byte 5th byte 6th byte 1 page read 2 page program 3 erase all blocks 4 read status register 5 clear status register 6 id check 7 download function 8 version data output function address (middle) address (middle) d0 16 srd output address (low) size (low) version data output address (high) address (high) srd1 output address (middle) size (high) version data output data output data input address (high) check- sum version data output data output data input id size data input version data output data output data input id1 to required number of times version data output data output to 259th byte data input to 259th byte to id7 version data output to 9th byte ff 16 41 16 a7 16 70 16 50 16 f5 16 fa 16 fb 16 when id is not verified not acceptable not acceptable not acceptable acceptable not acceptable acceptable not acceptable acceptable 1st byte transfer notes 1: shading indicates transfer from flash memory microcomputer to peripheral unit. all other data is transferred from the peripher al unit to the flash memory microcomputer. 2: srd refers to status register data. srd1 refers to status register 1 data. 3: all commands can be accepted when the flash memory is totally blank. 4: address high (a 16 to a 23 ) must be 00 16 . explained here below. basically, the software commands of the standard serial i/o mode is as same as that of the parallel i/o mode, but it is excluded 1 command of block erase, and it is added 3 com- mand of id check, download function, version data output function. table 17 software commands (standard serial i/o mode 1)
59 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers read status register command this command reads status information. when the 70 16 command code is sent with the 1st byte, the contents of the status register (srd) specified with the 2nd byte and the contents of status register 1 (srd1) specified with the 3rd byte are read. page read command this command reads the specified page (256 bytes) in the flash memory sequentially one byte at a time. execute the page read com- mand as explained here following. (1) transfer the ff 16 command code with the 1st byte. (2) transfer addresses a 8 to a 15 and a 16 to a 23 ( 00 16 ) with the 2nd and 3rd bytes respectively. (3) from the 4th byte onward, data (d 0 d 7 ) for the page (256 bytes) specified with addresses a 8 to a 23 will be output sequentially from the smallest address first in sync with the fall of the clock. fig. 57 timing for page read fig. 58 timing for reading the status register clear status register command this command clears the bits (sr4 sr5) which are set when the status register operation ends in error. when the 50 16 command code is sent with the 1st byte, the aforementioned bits are cleared. __________ when the clear status register operation ends, the s rdy1 (busy) signal changes from the h to the l level. fig. 59 timing for clearing the status register data0 data255 a 8 t o a 1 5 a 1 6 t o a 2 3 f f 1 6 s c l k r x d t x d s r d y 1 ( b u s y ) s r d o u t p u t s r d 1 o u t p u t s clk rxd txd s rdy1 (busy) 7 0 1 6 s clk rxd txd s rdy1 (busy) 50 16
60 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers page program command this command writes the specified page (256 bytes) in the flash memory sequentially one byte at a time. execute the page program command as explained here following. (1) transfer the 41 16 command code with the 1st byte. (2) transfer addresses a 8 to a 15 and a 16 to a 23 ( 00 16 ) with the 2nd and 3rd bytes respectively. (3) from the 4th byte onward, as write data (d 0 d 7 ) for the page (256 bytes) specified with addresses a 8 to a 23 is input sequentially from the smallest address first, that page is automatically written. __________ when reception setup for the next 256 bytes ends, the s rdy1 (busy) signal changes from the h to the l level. the result of the page program can be known by reading the status register. for more information, see the section on the status register. erase all blocks command this command erases the content of all blocks. execute the erase all blocks command as explained here following. (1) transfer the a7 16 command code with the 1st byte. (2) transfer the verify command code d0 16 with the 2nd byte. with the verify command code, the erase operation will start and con- tinue for all blocks in the flash memory. __________ when block erasing ends, the s rdy1 (busy) signal changes from the h to the l level . the result of the erase operation can be known by reading the status register. fig. 61 timing for erasing all blocks fig. 60 timing for the page program a 8 to a 15 a 16 to a 23 4 1 1 6 data0 d a t a 2 5 5 s c l k r x d t x d s r d y 1 ( b u s y ) a7 16 d0 16 s c l k r x d t x d s r d y 1 ( b u s y )
61 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers version information output command this command outputs the version information of the control pro- gram stored in the boot area. execute the version information output command as explained here following. download command this command downloads a program to the ram for execution. ex- ecute the download command as explained here following. (1) transfer the fa 16 command code with the 1st byte. (2) transfer the program size with the 2nd and 3rd bytes. (3) transfer the check sum with the 4th byte. the check sum is added to all data sent with the 5th byte onward. (4) the program to execute is sent with the 5th byte onward. when all data has been transmitted, if the check sum matches, the downloaded program is executed. the size of the program will vary according to the internal ram. fig. 62 timing for download (1) transfer the fb 16 command code with the 1st byte. (2) the version information will be output from the 2nd byte onward. this data is composed of 8 ascii code characters. fig. 63 timing for version information output f a 1 6 program data program data d a t a s i z e ( l o w ) c h e c k s u m s c l k r x d t x d s r d y 1 ( b u s y ) data size (high) f b 1 6 x v e r s c l k r x d t x d s r d y 1 ( b u s y )
62 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers id check this command checks the id code. execute the boot id check com- mand as explained here following. (1) transfer the f5 16 command code with the 1st byte. (2) transfer addresses a 0 to a 7 , a 8 to a 15 and a 16 to a 23 ( 00 16 ) of the 1st byte of the id code with the 2nd, 3rd and 4th bytes re- spectively. (3) transfer the number of data sets of the id code with the 5th byte. (4) the id code is sent with the 6th byte onward, starting with the 1st byte of the code. fig. 64 timing for the id check id code when the flash memory is not blank, the id code sent from the pe- ripheral units and the id code written in the flash memory are com- pared to see if they match. if the codes do not match, the command sent from the peripheral units is not accepted. an id code contains 8 bits of data. area is, from the 1st byte, addresses ffd4 16 to ffda 16 . write a program into the flash memory, which already has the id code set for these addresses. fig. 65 id code storage addresses i d s i z e i d 1 i d 7 f 5 1 6 d4 16 f f 1 6 00 16 s c l k r x d t x d s r d y 1 ( b u s y ) rom cord protect control id7 id6 id5 id4 id3 id2 id1 ffdb 16 ffda 16 ffd9 16 ffd8 16 ffd7 16 ffd6 16 ffd5 16 ffd4 16 address interrupt vector area
63 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers status register 1 (srd1) status register 1 indicates the status of serial communications, re- sults from id checks and results from check sum comparisons. it can be read after the srd by writing the read status register command (70 16 ). also, status register 1 is cleared by writing the clear status register command (50 16 ). table 19 gives the definition of each status register bit. 00 16 is out- put when power is turned on and the flag status is maintained even after the reset. boot update completed bit (sr15) this flag indicates whether the control program was downloaded to the ram or not, using the download function. status register (srd) the status register indicates operating status of the flash memory and status such as whether an erase operation or a program ended successfully or in error. it can be read by writing the read status reg- ister command (70 16 ). also, the status register is cleared by writing the clear status register command (50 16 ). table 18 gives the definition of each status register bit. after clearing the reset, the status register outputs 80 16 . sequencer status (sr7) after power-on and recover from deep power down mode, the se- quencer status is set to 1 (ready). the sequencer status indicates the operating status of the device. this status bit is set to 0 (busy) during write or erase operation and is set to 1 upon completion of these operations. erase status (sr5) the erase status reports the operating status of the auto erase op- eration. if an erase error occurs, it is set to 1 . when the erase sta- tus is cleared, it is set to 0 . program status (sr4) the program status reports the operating status of the auto write operation. if a write error occurs, it is set to 1 . when the program status is cleared, it is set to 0 . srd0 bits sr7 (bit7) sr6 (bit6) sr5 (bit5) sr4 (bit4) sr3 (bit3) sr2 (bit2) sr1 (bit1) sr0 (bit0) definition 1 0 table 18 status register (srd) table 19 status register 1 (srd1) 00 not verified 01 verification mismatch 10 reserved 11 verified sr15 (bit7) sr14 (bit6) sr13 (bit5) sr12 (bit4) sr11 (bit3) sr10 (bit2) sr9 (bit1) sr8 (bit0) boot update completed bit reserved reserved checksum match bit id check completed bits data reception time out reserved 1 update completed - - match time out - 0 not update - - mismatch normal operation - definition srd1 bits status name status name sequencer status reserved erase status program status reserved reserved reserved reserved ready - terminated in error terminated in error - - - - busy - terminated normally terminated normally - - - - check sum consistency bit (sr12) this flag indicates whether the check sum matches or not when a program is downloaded for execution using the download function. id check completed bits (sr11 and sr10) these flags indicate the result of id checks. some commands can- not be accepted without an id check. data reception time out (sr9) this flag indicates when a time out error is generated during data reception. if this flag is attached during data reception, the received data is discarded and the microcomputer returns to the command wait state.
64 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers full status check results from executed erase and program operations can be known example circuit application for the standard serial i/o mode fig. 66 full status check flowchart and remedial procedure for errors fig. 67 example circuit application for the standard serial i/o mode by running a full status check. figure 66 shows a flowchart of the full status check and explains how to remedy errors which occur. figure 67 shows a circuit application for the standard serial i/o mode. control pins will vary according to programmer, therefore see the peripheral unit manual for more information. r e a d s t a t u s r e g i s t e r s r 4 = 1 a n d s r5 = 1 ? n o c o m m a n d s e q u e n c e e r r o r y e s s r 5 = 0 ? y e s er a s e e r r o r n o s r 4 = 0 ? y e s program error n o end (block erase, program) execute the clear status register command (50 16 ) to clear the status register. try performing the operation one more time after confirming that the command is entered correctly. should a block erase error occur, the block in error cannot be used. n o t e : w h e n o n e o f s r 5 t o s r 4 i s s e t t o 1 , n o n e o f t h e p r o g r a m , e r a s e a l l b l o c k s c o m m a n d s i s a c c e p t e d . e x e c u t e t h e c l e a r s t a t u s r e g i s t e r c o m m a n d ( 5 0 1 6 ) b e f o r e e x e c u t i n g t h e s e c o m m a n d s . should a program error occur, the block in error cannot be used. s r d y 1 ( b u s y ) s c l k r x d t x d c n v s s c l o c k i n p u t b u s y o u t p u t d a t a i n p u t d a t a o u t p u t m 3 8 5 0 7 f 8 n o t e s 1 : c o n t r o l p i n s a n d e x t e r n a l c i r c u i t r y w i l l v a r y a c c o r d i n g t o p e r i p h e r a l u n i t . f o r m o r e i n f o r m a t i o n , s e e t h e p e r i p h e r a l u n i t m a n u a l . 2 : i n t h i s e x a m p l e , t h e v p p p o w e r s u p p l y i s s u p p l i e d f r o m a n e x t e r n a l s o u r c e ( w r i t e r ) . t o u s e t h e u s e r s p o w e r s o u r c e , c o n n e c t t o 4 . 5 v t o 5 . 5 v . v p p p o w e r s o u r c e i n p u t p 4 1
65 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers table 21 flash memory mode electrical characteristics (ta = 25 o c, v cc = 4.5 to 5.5v unless otherwise noted) flash memory electrical characteristics v pp power source current (read) v pp power source current (program) v pp power source current (erase) l input voltage (note) h input voltage (note) v pp power source voltage limits parameter min. typ. max. symbol unit note: input pins for parallel i/o mode. v pp = v cc v pp = v cc v pp = v cc microcomputer mode operation at v cc = 2.7 to 5.5v microcomputer mode operation at v cc = 2.7 to 3.6v conditions i pp1 i pp2 i pp3 v il v ih v pp 0 2.0 4.5 100 60 30 0.8 v cc 5.5 a ma ma v v v table 20 absolute maximum ratings power source voltage input voltage p0 0 p0 7 , p1 0 p1 7 , p2 0 , p2 1, p2 4 p2 7 , p3 0 p3 4 , p4 0 p4 4 , v ref input voltage p2 2 , p2 3 input voltage reset, x in input voltage cnv ss output voltage p0 0 p0 7 , p1 0 p1 7 , p2 0 , p2 1, p2 4 p2 7 , p3 0 p3 4 , p4 0 p4 4 , x out output voltage p2 2 , p2 3 power dissipation operating temperature storage temperature v cc v i v i v i v i v o v o p d t opr t stg symbol parameter conditions ratings 0.3 to 6.5 0.3 to v cc +0.3 0.3 to 5.8 0.3 to v cc +0.3 0.3 to v cc +0.3 0.3 to v cc +0.3 0.3 to 5.8 1000 (note) 255 40 to 125 v v v v v v v mw c c unit t a = 25 c all voltages are based on v ss . output transistors are cut off. note: the rating becomes 300 mw at the 42p2r-a/e package. v cc v cc power source voltage 4.5 3.0 5.5 3.6 v v
66 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers ac electrical characteristics (ta = 25 o c, v cc = 4.5 to 5.5v unless otherwise noted) table 22 read-only mode read cycle time address access time _____ ce access time _____ oe access time _____ output enable time (after ce) _____ output floating time (after ce) _____ output enable time (after oe) _____ output floating time (after oe) _____ output floating time (after pr) _____ _____ output valid time (after ce, oe, address) write recovery time (before read) _____ rp recovery time limits ns ns ns ns ns ns ns ns ns ns ns s parameter min. 200 0 0 0 200 10 typ. max. 100 100 80 25 25 300 symbol unit note : timing measurement condition is showed in figure 71. t rc ta (ad) ta (ce) ta (oe) t clz t df(ce) t olz t df(oe) t phz t oh t oeh t ps limits parameter 200 100 25 100 25 0 0 100 50 10 symbol unit note : the read timing parameter in the command write operation mode is same as that of the read-only mode. typical value is at v cc = 5.0 v, ta = 25 c condition. write cycle time address set up time address hold time data set up time data hold time _____ ce set up time _____ ce hold time _____ we pulse width h write pulse width program time erase all blocks time _____ ry/by delay time _____ rp recovery time t wc t as t ah t ds t dh t cs t ch t wp t wph t dap t dae t whrl t ps min. typ. max. 25 1.5 200 ns ns ns ns ns ns ns ns ns s s ns s _____ table 23 read / write mode (we control)
67 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers limits parameter 200 100 25 100 25 0 0 100 50 10 symbol unit write cycle time address set up time address hold time data set up time data hold time ______ we set up time ______ we hold time _____ ce pulse width _____ h ce pulse width program time erase all blocks time _____ ry/by delay time _____ rp recovery time t wc t as t ah t ds t dh t ws t wh t cep t ceph t dap t dae t ehrl t ps min. typ. max. 25 1.5 200 ns ns ns ns ns ns ns ns ns s s ns s _____ table 24 read / write mode (ce control) parameter erase all blocks time block erase time program time (1byte) 1.5 1.0 25 s s s min. typ. max. unit table 25 erase and program operation symbol min. typ. max. unit table 26 v cc power up / power down timing parameter _____ rp = v ih set up time (after rised v cc = v cc min.) t vcs 10 note : the read timing parameter in the command write operation mode is same as that of the read-only mode. typical value is at v cc = 5.0 v, ta = 25 c condition. note : miserase or miswrite may happen, in case of noise pulse due to the power supply on or off is input to the control pins. therefo re disableing the write mode is need for prevent from memory data break at the power supply on or off. 10 s (min.) waiting time is need to initiate read or write op- _____ eration after v cc rises to v cc min. at power supply on. the memory data is protected owing to keep the rp pin v il level at power supply off. the _____ _____ rp pin must be kept v il level for 10 s (min.) after v cc rises to v cc min. at the power supply on. the rp pin must be kept v il level until the v cc _____ _____ falls to the gnd level at power supply off. rp pin doesn't have latch mode, so rp pin must be kept v ih level during read, erase and program op- eration. flash memory mode electrical characteristics (ta = 25 o c, v cc = 4.5 to 5.5v unless otherwise noted) s
68 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 68 v cc power up / power down timing 5.0v gnd v cc v ih v il rp inhibit read / write t vcs v ih v il ce v ih v il we t ps t ps inhibit read / write inhibit read / write
69 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 69 _____ ac wave for program operation (we control) fig. 70 _____ ac wave for program operation (ce control) v ih v il address v ih v il v ih v il v ih vo h ce oe we data ry/by v il v ih v il vo l 40h din t cs t ch t wph t wp t ds t whrl t oeh t a(ce) t a(oe) t dh srd ffh t ah t as t wc v ih v il rp t ps t dap valid address valid address program read status register write read array command v ih v il address v ih v il v ih v il v ih vo h ce oe we data ry/by v il v ih v il vo l 40h din t ws t wh t cep t ds t ehrl t oeh t a(ce) t a(oe) t dh srd ffh t ah t as t wc v ih v il rp t ps t dap program read status register write read array command valid address valid address
70 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 71 ac wave for read operation and test condition fig. 72 ac electrical characteristics test condition valid output high-z t df(oe) t rc v ih v il v ih v il v ih v il v ih v il v oh v ol address ce oe we data valid address t oh t olz t a (ce) t oeh t clz t a (ad) t a (oe) high-z v ih v il rp t ps t df(ce) t phz 3.3k 1n914 1.3v c l =100pf ac electrical characteristics test condition input voltage : v il = 0v, v ih = 5.0v input signal rising time, falling time : 10ns timing measurement reference voltage : 1.5v load circuit : 1ttl gate+ cl(100pf ) or measurement pin
71 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 73 _____ ac wave for erase operation (we control) fig. 74 _____ ac wave for erase operation (ce control) 20h d0h t wph t wp t ds t dh t cs t ch t wc v ih v il v ih v il v ih v il v ih v il t ah v ih v oh v ol v il address t as ffh srd t oeh t dae t whrl t a(oe) t a(ce) ce oe we data ry/by v ih v il t ps rp erase read status register write read array command valid address valid address 20h d0h t ceph t cep t ds t dh t ws t wh t wc v ih v il v ih v il v ih v il v ih v il t ah v ih v oh v ol v il address t as ffh srd t oeh t dae t ehrl t a(oe) t a(ce) ce oe we data ry/by v ih v il t ps rp valid address erase read status register write read array command valid address
72 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers notes on programming processor status register the contents of the processor status register (ps) after a reset are undefined, except for the interrupt disable flag (i) which is 1. af- ter a reset, initialize flags which affect program execution. in particular, it is essential to initialize the index x mode (t) and the decimal mode (d) flags because of their effect on calculations. interrupts the contents of the interrupt request bits do not change immedi- ately after they have been written. after writing to an interrupt request register, execute at least one instruction before perform- ing a bbc or bbs instruction. decimal calculations to calculate in decimal notation, set the decimal mode flag (d) to 1 , then execute an adc or sbc instruction. after executing an adc or sbc instruction, execute at least one instruction be- fore executing a sec, clc, or cld instruction. in decimal mode, the values of the negative (n), overflow (v), and zero (z) flags are invalid. timers if a value n (between 0 and 255) is written to a timer latch, the fre- quency division ratio is 1/(n+1). multiplication and division instructions the index x mode (t) and the decimal mode (d) flags do not af- fect the mul and div instruction. the execution of these instructions does not change the con- tents of the processor status register. ports the contents of the port direction registers cannot be read. the following cannot be used: the data transfer instruction (lda, etc.) the operation instruction when the index x mode flag (t) is 1 the addressing mode which uses the value of a direction regis- ter as an index the bit-test instruction (bbc or bbs, etc.) to a direction register the read-modify-write instructions (ror, clb, or seb, etc.) to a direction register. use instructions such as ldm and sta, etc., to set the port direc- tion registers. serial i/o in clock synchronous serial i/o, if the receive side is using an ex- ternal clock and it is to output the s rdy1 signal, set the transmit enable bit, the receive enable bit, and the s rdy1 output enable bit to 1. serial i/o1 continues to output the final bit from the t x d pin after transmission is completed. s out2 pin for serial i/o2 goes to high impedance after transmis- sion is completed. when an external clock is used as synchronous clock in serial i/ o1 or serial i/o2, write transmission data to the transmit buffer register or serial i/o2 register while the transfer clock is h. a-d converter the comparator uses capacitive coupling amplifier whose charge will be lost if the clock frequency is too low. therefore, make sure that f(x in ) in the middle/high-speed mode is at least on 500 khz during an a-d conversion. do not execute the stp or wit instruction during an a-d conver- sion. instruction execution time the instruction execution time is obtained by multiplying the fre- quency of the internal clock by the number of cycles needed to execute an instruction. the number of cycles required to execute an instruction is shown in the list of machine instructions. the frequency of the internal clock is half of the x in frequency in high-speed mode. notes on usage differences between 3850 group (standard) and 3850 group (spec. h) (1) the absolute maximum ratings of 3850 group (spec. h) is smaller than that of 3850 group (standard). power source voltage vcc = 0.3 to 6.5 v cnvss input voltage v i = 0.3 to vcc +0.3 v (2) the oscillation circuit constants of x in -x out , x cin -x cout may be some differences between 3850 group (standard) and 3850 group (spec. h). (3) do not write any data to the reserved area and the reserved bit. (do not change the contents after rest.) (4) fix bit 3 of the cpu mode register to 1 . (5) be sure to perform the termination of unused pins. handling of source pins in order to avoid a latch-up occurrence, connect a capacitor suit- able for high frequencies as bypass capacitor between power source pin (v cc pin) and gnd pin (v ss pin) and between power source pin (v cc pin) and analog power source input pin (av ss pin). besides, connect the capacitor to as close as possible. for bypass capacitor which should not be located too far from the pins to be connected, a ceramic capacitor of 0.01 f 0.1 f is recom- mended. eprom version/one time prom version/ flash memory version the cnvss pin is connected to the internal memory circuit block by a low-ohmic resistance, since it has the multiplexed function to be a programmable power source pin (v pp pin) as well. to improve the noise reduction, connect a track between cnvss pin and vss pin or vcc pin with 1 to 10 k ? resistance. the mask rom version track of cnvss pin has no operational in- terference even if it is connected to vss pin or vcc pin via a resistor.
73 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers data required for mask orders the following are necessary when ordering a mask rom produc- tion: 1. mask rom order confirmation form ? 1 2. mark specification form ? 2 3. data to be written to rom, in eprom form (three identical cop- ies) or one floppy disk. data required for one time prom programming orders the following are necessary when ordering a prom programming service: 1. rom programming confirmation form ? 1 2. mark specification form ? 2 (only special mark with customer s trade mark logo) 3. data to be programmed to prom, in eprom form (three iden- tical copies) or one floppy disk. for the mask rom confirmation and the mark specifications, refer to the mitsubishi mcu technical information homepage. ? 1 mask rom confirmation forms http://www.infomicom.mesc.co.jp/38000/38ordere.htm ? 2 mark specification forms http://www.infomicom.mesc.co.jp/mela/markform.htm rom programming method the built-in prom of the blank one time prom version and buit- in eprom version can be read or programmed with a general-purpose prom programmer using a special programming adapter. set the address of prom programmer in the user rom area. table 27 programming adapter package 42p4b, 42s1b 42p2r-a/e name of programming adapter pca4738s-42a pca4738f-42a the prom of the blank one time prom version is not tested or screened in the assembly process and following processes. to en- sure proper operation after programming, the procedure shown in figure 75 is recommended to verify programming. fig. 75 programming and testing of one time prom version programming with prom programmer screening (caution) (150 c for 40 hours) verification with prom programmer functional check in target device the screening temperature is far highe r than the storage temperature. neve r expose to 150 c exceeding 100 hours. caution :
74 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers v cc v ss v ref av ss v ia v ih v ih v il v il v il electrical characteristics table 28 absolute maximum ratings power source voltage input voltage p0 0 p0 7 , p1 0 p1 7 , p2 0 , p2 1, p2 4 p2 7 , p3 0 p3 4 , p4 0 p4 4 , v ref input voltage p2 2 , p2 3 input voltage reset, x in input voltage cnv ss output voltage p0 0 p0 7 , p1 0 p1 7 , p2 0 , p2 1, p2 4 p2 7 , p3 0 p3 4 , p4 0 p4 4 , x out output voltage p2 2 , p2 3 power dissipation operating temperature storage temperature v cc v i v i v i v i v o v o p d t opr t stg symbol parameter conditions ratings 0.3 to 6.5 0.3 to v cc +0.3 0.3 to 5.8 0.3 to v cc +0.3 0.3 to v cc +0.3 0.3 to v cc +0.3 0.3 to 5.8 1000 (note) 20 to 85 40 to 125 v v v v v v v mw c c unit t a = 25 c all voltages are based on v ss . output transistors are cut off. 5.5 5.5 v cc v cc v cc v cc 0.2v cc 0.2v cc 0.16v cc power source voltage power source voltage a-d convert reference voltage analog power source voltage analog input voltage an 0 an 4 h input voltage p0 0 p0 7 , p1 0 p1 7 , p2 0 p2 7 , p3 0 p3 4 , p4 0 p4 4 h input voltage reset, x in , cnv ss l input voltage p0 0 p0 7 , p1 0 p1 7 , p2 0 p2 7 , p3 0 p3 4 , p4 0 p4 4 l input voltage reset, cnv ss l input voltage x in symbol parameter limits min. unit table 29 recommended operating conditions (1) (v cc = 2.7 to 5.5 v, t a = ?0 to 85 ?, unless otherwise noted) 4.0 2.7 2.0 av ss 0.8v cc 0.8v cc 0 0 0 5.0 5.0 0 0 typ. max. 80 80 80 120 80 40 40 40 60 40 h total peak output current p0 0 p0 7 , p1 0 p1 7 , p3 0 p3 4 (note) h total peak output current p2 0 , p2 1 , p2 4 p2 7 , p4 0 p4 4 (note) l total peak output current (note) p0 0 p0 7 , p3 0 p3 4 l total peak output current (note) p1 0 p1 7 l total peak output current p2 0 p2 7 ,p4 0 p4 4 (note) h total average output current p0 0 p0 7 , p1 0 p1 7 , p3 0 p3 4 (note) h total average output current p2 0 , p2 1 , p2 4 p2 7 , p4 0 p4 4 (note) l total average output current (note) p0 0 p0 7 , p3 0 p3 4 l total average output current (note) p1 0 p1 7 l total average output current p2 0 p2 7 ,p4 0 p4 4 (note) i oh(peak) i oh(peak) i ol(peak) i ol(peak) i ol(peak) i oh(avg) i oh(avg) i ol(avg) i ol(avg) i ol(avg) ma ma ma ma ma ma ma ma ma ma note : the total output current is the sum of all the currents flowing through all the applicable ports. the total average current is an average value measured over 100 ms. the total peak current is the peak value of all the currents. v v v v v v v v v v note : the rating becomes 300mw at the 42p2r-a/e package. 8 mhz (high-speed mode) 8 mhz (middle-speed mode), 4 mhz (high-speed mode)
75 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers table 30 recommended operating conditions (2) (v cc = 2.7 to 5.5 v, t a = ?0 to 85 ?, unless otherwise noted) 10 10 20 5 5 15 8 4 h peak output current p0 0 p0 7 , p1 0 p1 7 , p2 0 , p2 1 , p2 4 p2 7 , p3 0 p3 4 , p4 0 p4 4 (note 1) l peak output current (note 1) p0 0 p0 7 , p2 0 p2 7 , p3 0 p3 4 , p4 0 p4 4 l peak output current (note 1) p1 0 p1 7 h average output current p0 0 p0 7 , p1 0 p1 7 , p2 0 , p2 1 , p2 4 p2 7 , p3 0 p3 4 , p4 0 p4 4 (note 2) l average output current (note 2) p0 0 p0 7 , p2 0 p2 7 , p3 0 p3 4 , p4 0 p4 4 l average output current (note 2) p1 0 p1 7 internal clock oscillation frequency (v cc = 4.0 to 5.5v) (note 3) internal clock oscillation frequency (v cc = 2.7 to 5.5v) (note 3) i oh(peak) i ol(peak) i ol(peak) i oh(avg) i ol(avg) i ol(avg) f(x in ) f(x in ) symbol parameter limits min. ma ma ma ma ma ma mhz mhz unit typ. max. notes 1: the peak output current is the peak current flowing in each port. 2: the average output current i ol (avg), i oh (avg) are average value measured over 100 ms. 3: when the oscillation frequency has a duty cycle of 50%.
76 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers table 31 electrical characteristics (1) (v cc = 2.7 to 5.5 v, v ss = 0 v, t a = ?0 to 85 ?, unless otherwise noted) h output voltage p0 0 p0 7 , p1 0 p1 7 , p2 0 , p2 1, p2 4 p2 7 , p3 0 p3 4 , p4 0 p4 4 (note) l output voltage p0 0 p0 7 , p2 0 p2 7, p3 0 p3 4 , p4 0 p4 4 l output voltage p1 0 p1 7 hysteresis cntr 0 , cntr 1 , int 0 int 3 hysteresis rxd, s clk hysteresis ____________ reset h input current p0 0 p0 7 , p1 0 p1 7 , p2 0 , p2 1, p2 4 p2 7 , p3 0 p3 4 , p4 0 p4 4 h input current ____________ reset, cnv ss h input current x in l input current p0 0 p0 7 , p1 0 p1 7 , p2 0 p2 7 p3 0 p3 4 , p4 0 p4 4 l input current ____________ reset,cnv ss l input current x in ram hold voltage limits v v v v v v v v v a a a a a a v parameter min. typ. max. symbol unit note: p2 5 is measured when the p2 5 /t x d p-channel output disable bit of the uart control register (bit 4 of address 001b 16 ) is 0 . i oh = 10 ma v cc = 4.0 5.5 v i oh = 1.0 ma v cc = 2.7 5.5 v i ol = 10 ma v cc = 4.0 5.5 v i ol = 1.0 ma v cc = 2.7 5.5 v i ol = 20 ma v cc = 4.0 5.5 v i ol = 10 ma v cc = 2.7 5.5 v v i = v cc v i = v cc v i = v cc v i = v ss v i = v ss v i = v ss when clock stopped v cc 2.0 v cc 1.0 2.0 test conditions 0.4 0.5 0.5 4 4 2.0 1.0 2.0 1.0 5.0 5.0 5.0 5.0 5.5 v oh v ol v ol v t+ v t v t+ v t v t+ v t i ih i ih i ih i il i il i il v ram
77 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers table 32 electrical characteristics (2) (v cc = 2.7 to 5.5 v, v ss = 0 v, t a = ?0 to 85 ?, unless otherwise noted) power source current limits parameter min. typ. max. symbol unit high-speed mode f(x in ) = 8 mhz f(x cin ) = 32.768 khz output transistors off high-speed mode f(x in ) = 8 mhz (in wit state) f(x cin ) = 32.768 khz output transistors off low-speed mode f(x in ) = stopped f(x cin ) = 32.768 khz output transistors off low-speed mode f(x in ) = stopped f(x cin ) = 32.768 khz (in wit state) output transistors off low-speed mode (v cc = 3 v) f(x in ) = stopped f(x cin ) = 32.768 khz output transistors off low-speed mode (v cc = 3 v) f(x in ) = stopped f(x cin ) = 32.768 khz (in wit state) output transistors off middle-speed mode f(x in ) = 8 mhz f(x cin ) = stopped output transistors off middle-speed mode f(x in ) = 8 mhz (in wit state) f(x cin ) = stopped output transistors off increment when a-d conversion is executed f(x in ) = 8 mhz test conditions 13 i cc ta = 25 c ta = 85 c 6.8 ma all oscillation stopped (in stp state) output transistors off 1.6 60 20 20 5.0 4.0 1.5 800 0.1 200 40 55 10.0 7.0 1.0 10 ma a a a a ma ma a a a except m38507f8fp/sp m38507f8fp/sp except m38507f8fp/sp m38507f8fp/sp t.b.d. t.b.d. a a
78 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers bit lsb 2tc(x in ) s k ? a a resolution absolute accuracy (excluding quantization error) conversion time ladder resistor reference power source input current a-d port input current min. 50 typ. 40 35 150 0.5 max. 10 4 61 200 5.0 5.0 high-speed mode, middle-speed mode low-speed mode v ref = 5.0 v table 33 a-d converter characteristics (v cc = 2.7 to 5.5 v, v ss = av ss = 0 v, t a = ?0 to 85 ?, f(x in ) = 8 mhz, unless otherwise noted) unit limits parameter t conv r ladder i vref i i(ad) test conditions symbol v ref on v ref off
79 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers timing requirements table 34 timing requirements (1) (v cc = 4.0 to 5.5 v, v ss = 0 v, t a = ?0 to 85 ?, unless otherwise noted) reset input l pulse width external clock input cycle time external clock input h pulse width external clock input l pulse width cntr 0 , cntr 1 input cycle time cntr 0 , cntr 1 input h pulse width cntr 0 , cntr 1 input l pulse width int 0 to int 3 input h pulse width int 0 to int 3 input l pulse width serial i/o1 clock input cycle time (note) t w (reset) t c (x in ) t wh (x in ) t wl (x in ) t c (cntr) t wh (cntr) t wl (cntr) t wh (int) t wl (int) t c (s clk1 ) t wh (s clk1 ) t wl (s clk1 ) t su (r x d-s clk1 ) t h (s clk1 -r x d) t c (s clk2 ) t wh (s clk2 ) t wl (s clk2 ) t su (s in2 -s clk2 ) t h (s clk2 -s in2 ) limits x in cycle ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns parameter min. 20 125 50 50 200 80 80 80 80 800 370 370 220 100 1000 400 400 200 200 typ. max. symbol unit note : when f(x in ) = 8 mhz and bit 6 of address 001a 16 is 1 (clock synchronous). divide this value by four when f(x in ) = 8 mhz and bit 6 of address 001a 16 is 0 (uart). serial i/o1 clock input h pulse width (note) serial i/o1 clock input l pulse width (note) serial i/o1 input setup time serial i/o1 input hold time serial i/o2 clock input cycle time serial i/o2 clock input h pulse width serial i/o2 clock input l pulse width serial i/o2 clock input setup time serial i/o2 clock input hold time table 35 timing requirements (2) (v cc = 2.7 to 5.5 v, v ss = 0 v, t a = ?0 to 85 ?, unless otherwise noted) reset input l pulse width external clock input cycle time external clock input h pulse width external clock input l pulse width cntr 0 , cntr 1 input cycle time cntr 0 , cntr 1 input h pulse width cntr 0 , cntr 1 input l pulse width int 0 to int 3 input h pulse width int 0 to int 3 input l pulse width serial i/o1 clock input cycle time (note) serial i/o1 clock input h pulse width (note) serial i/o1 clock input l pulse width (note) serial i/o1 input setup time serial i/o1 input hold time serial i/o2 clock input cycle time serial i/o2 clock input h pulse width serial i/o2 clock input l pulse width serial i/o2 clock input setup time serial i/o2 clock input hold time t w (reset) t c (x in ) t wh (x in ) t wl (x in ) t c (cntr) t wh (cntr) t wl (cntr) t wh (int) t wl (int) t c (s clk1 ) t wh (s clk1 ) t wl (s clk1 ) t su (r x d-s clk1 ) t h (s clk1 -r x d) t c (s clk2 ) t wh (s clk2 ) t wl (s clk2 ) t su (s in2 -s clk2 ) t h (s clk2 -s in2 ) limits x in cycle ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns parameter min. 20 250 100 100 500 230 230 230 230 2000 950 950 400 200 2000 950 950 400 300 typ. max. symbol unit note : when f(x in ) = 4 mhz and bit 6 of address 001a 16 is 1 (clock synchronous). divide this value by four when f(x in ) = 4 mhz and bit 6 of address 001a 16 is 0 (uart).
80 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers table 36 switching characteristics (1) (v cc = 4.0 to 5.5 v, v ss = 0 v, t a = ?0 to 85 ?, unless otherwise noted) serial i/o1 clock output h pulse width serial i/o1 clock output l pulse width serial i/o1 output delay time (note 1) serial i/o1 output valid time (note 1) serial i/o1 clock output rising time serial i/o1 clock output falling time serial i/o2 clock output h pulse width serial i/o2 clock output l pulse width serial i/o2 output delay time (note 2) serial i/o2 output valid time (note 2) serial i/o2 clock output falling time cmos output rising time (note 3) cmos output falling time (note 3) t wh (s clk1 ) t wl (s clk1 ) t d (s clk1 -t x d) t v (s clk1 -t x d) t r (s clk1 ) t f (s clk1 ) t wh (s clk2 ) t wl (s clk2 ) t d (s clk2 -s out2 ) t v (s clk2 -s out2 ) t f (s clk2 ) t r (cmos) t f (cmos) limits ns ns ns ns ns ns ns ns ns ns ns ns ns parameter min. t c (s clk1 )/2 30 t c (s clk1 )/2 30 30 t c (s clk2 )/2 160 t c (s clk2 )/2 160 0 typ. 10 10 max. 140 30 30 200 30 30 30 symbol unit notes 1: when the p2 5 /t x d p-channel output disable bit of the uart control register (bit 4 of address 001b 16 ) is 0 . 2: when the p0 1 /s out2 and p0 2 /s clk2 p-channel output disable bit of the serial i/o2 control register 1 (bit 7 of address 0015 16 ) is 0 . 3: the x out pin is excluded. test conditions fig.76 table 37 switching characteristics (2) (v cc = 2.7 to 5.5 v, v ss = 0 v, t a = ?0 to 85 ?, unless otherwise noted) serial i/o1 clock output h pulse width serial i/o1 clock output l pulse width serial i/o1 output delay time (note 1) serial i/o1 output valid time (note 1) serial i/o1 clock output rising time serial i/o1 clock output falling time serial i/o2 clock output h pulse width serial i/o2 clock output l pulse width serial i/o2 output delay time (note 2) serial i/o2 output valid time (note 2) serial i/o2 clock output falling time cmos output rising time (note 3) cmos output falling time (note 3) t wh (s clk1 ) t wl (s clk1 ) t d (s clk1 -t x d) t v (s clk1 -t x d) t r (s clk1 ) t f (s clk1 ) t wh (s clk2 ) t wl (s clk2 ) t d (s clk2 -s out2 ) t v (s clk2 -s out2 ) t f (s clk2 ) t r (cmos) t f (cmos) limits ns ns ns ns ns ns ns ns ns ns ns ns ns parameter min. t c (s clk1 )/2 50 t c (s clk1 )/2 50 30 t c (s clk2 )/2 240 t c (s clk2 )/2 240 0 typ. 20 20 max. 350 50 50 400 50 50 50 symbol unit notes 1: when the p2 5 /t x d p-channel output disable bit of the uart control register (bit 4 of address 001b 16 ) is 0 . 2: when the p0 1 /s out2 and p0 2 /s clk2 p-channel output disable bit of the serial i/o2 control register 1 (bit 7 of address 0015 16 ) is 0 . 3: the x out pin is excluded. test conditions fig.76
81 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 76 circuit for measuring output switching characteristics measurement output pin 1 0 0 p f c m o s o u t p u t
82 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers fig. 77 timing diagram t c(cntr) 0.2v cc t wl(int) 0.8v cc t wh(int) 0.2v cc 0.8v cc t w(reset) reset 0.2v cc t wl(cntr) 0.8v cc t wh(cntr) 0.2v cc 0.2v cc 0.8v cc 0.8v cc 0.2v cc t wl(x in ) 0.8v cc t wh(x in ) t c(x in ) x in t f t r t d(s clk1 -t x d), t d(s clk2 -s out2 ) t v(s clk1 -t x d), t v(s clk2 -s out2 ) t c(s clk1 ), t c(s clk2 ) t wl(s clk1 ), t wl(s clk2 ) t wh(s clk1 ), t wh(s clk2 ) t h(s clk1 - r x d), t h(s clk2 - s in2 ) t su(r x d - s clk1 ), t su(s in2 - s clk2 ) t x d s out2 r x d s in2 s clk1 s clk2 int 0 to int 3 cntr 0 cntr 1
83 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers package outline sdip42-p-600-1.78 weight(g) jedec code 4.1 eiaj package code lead material alloy 42/cu alloy 42p4b plastic 42pin 600mil sdip symbol min nom max a a 2 b b 1 b 2 c e d l dimension in millimeters a 1 0.51 3.8 0.35 0.45 0.55 0.9 1.0 1.3 0.63 0.73 1.03 0.22 0.27 0.34 36.5 36.7 36.9 12.85 13.0 13.15 1.778 15.24 3.0 0 15 5.5 e e 1 42 22 21 1 e c e 1 a 2 a 1 b b 1 b 2 e l a seating plane d ssop42-p-450-0.80 weight(g) jedec code 0.63 eiaj package code lead material alloy 42 42p2r-a/e plastic 42pin 450mil ssop symbol min nom max a a 2 b c d e l l 1 y dimension in millimeters h e a 1 i 2 .25 0 .05 0 .13 0 .3 17 .2 8 .63 11 .3 0 .27 1 .0 2 .3 0 .15 0 .5 17 .4 8 .8 0 .93 11 .5 0 .765 1 .43 11 .4 2 .4 0 .2 0 .7 17 .6 8 .23 12 .7 0 .15 0 b 2 .5 0 0 10 e e 1 42 22 21 1 h e e d e y f a a 2 a 1 l 1 l c e b 2 e 1 i 2 recommended mount pad detail f z z 1 detail g z 1 0.75 0.9 z b g
84 3850 group (spec. h) single-chip 8-bit cmos microcomputer mitsubishi microcomputers wdip42-c-600-1.78 weight(g) jedec code eiaj package code 42s1b-a metal seal 42pin 600mil dip 0.46 0.25 3.44 15.8 3.05 symbol min nom max a a 2 b b 1 c d e l z dimension in millimeters a 1 3.05 15.24 1.778 41.1 0.33 0.17 0.9 0.8 0.7 0.54 0.38 1.0 5.0 e e 1 e e d 1 42 22 21 b z seating plane a l a 2 a 1 b 1 e 1 c
? 2000 mitsubishi electric corp. new publication, effective dec. 2000. specifications subject to change without notice. notes regarding these materials these materials are intended as a reference to assist our customers in the selection of the mitsubishi semiconductor product be st suited to the customer s application; they do not convey any license under any intellectual property rights, or any other rights, belonging to mitsubishi electric corporation or a third party. mitsubishi electric corporation assumes no responsibility for any damage, or infringement of any third-party s rights, originating in the use of any product data, diagrams, charts, programs, algorithms, or circuit application examples contained in these materials. all information contained in these materials, including product data, diagrams, charts, programs and algorithms represents info rmation on products at the time of publication of these materials, and are subject to change by mitsubishi electric corporation without notice due to product improvements or other reasons. it is therefore recommended that c ustomers contact mitsubishi electric corporation or an authorized mitsubishi semiconductor product distributor for the latest product information before purchasing a product listed herein. the information described here may contain technical inaccuracies or typographical errors. mitsubishi electric corporation assu mes no responsibility for any damage, liability, or other loss rising from these inaccuracies or errors. please also pay attention to information published by mitsubishi electric corporation by various means, including the mitsubish i semiconductor home page (http://www.mitsubishichips.com). when using any or all of the information contained in these materials, including product data, diagrams, charts, programs, and algorithms, please be sure to evaluate all information as a total system before making a final decision on the applicability of the information and products. mitsubishi electric corporation assumes no responsibility for any damage, liability or other loss resulting from the information contained herein. mitsubishi electric corporation semiconductors are not designed or manufactured for use in a device or system that is used unde r circumstances in which human life is potentially at stake. please contact mitsubishi electric corporation or an authorized mitsubishi semiconductor product distributor when considering the use of a product contained herei n for any specific purposes, such as apparatus or systems for transportation, vehicular, medical, aerospace, nuclear, or undersea repeater use. the prior written approval of mitsubishi electric corporation is necessary to reprint or reproduce in whole or in part these ma terials. if these products or technologies are subject to the japanese export control restrictions, they must be exported under a licens e from the japanese government and cannot be imported into a country other than the approved destination. any diversion or reexport contrary to the export control laws and regulations of japan and/or the country of destination is pro hibited. please contact mitsubishi electric corporation or an authorized mitsubishi semiconductor product distributor for further detail s on these materials or the products contained therein. keep safety first in your circuit designs! mitsubishi electric corporation puts the maximum effort into making semiconductor products better and more reliable, but there is always the possibility that trouble may occur with them. trouble with semiconductors may lead to personal injury, fire or property damage. remember to give due consideration to safety when making your circuit designs, with a ppropriate measures such as (i) placement of substitutive, auxiliary circuits, (ii) use of non-flammable material or (iii) prevention against any malfunction or mishap. head office: 2-2-3, marunouchi, chiyoda-ku, tokyo 100-8310, japan
rev. rev. no. date 1.0 first edition 000309 1.1 font errors are revised. 000322 2.0 page 1; interrupts of features is revised. 001222 page 1; figure 1 is partly revised. page 6; table 3 is partly revised. page 17; explanations of interrupts are partly revised. page 23; figure 20 is partly revised. page 27; figure 24 is partly revised. page 33; explanations of reset circuit are partly revised. page 36; note 1 into figure 42 is partly revised. pages 38 to 71; explanations of flash memory version are added. page 41; figure 45 is partly revised. page 72; eprom version/one time prom version/flash memory version of notes on usage is added. page 73; data required for mask orders is added. page 73; data required for one time prom programming orders is added. page 73; rom programming method is added. page 77; table 32 is partly revised. page 79; limit of tw(reset) into table 34 is revised. page 79; limit of tw(reset) into table 35 is revised. revision description list 3850 group (spec. h) data sheet (1/1) revision description


▲Up To Search▲   

 
Price & Availability of M38503E4FP

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X